I am currently looking in to some file uploading using Java Server Faces. I've found this great introduction to it using RichFaces. However, I have some troubles understanding the process here.
First the user selects a file and if the immediate upload is set to true the file is processed using ajax, so far so good. When it comes to the next step however, the listener on the Bean-side the following confuses me:
public void listener(UploadEvent event) throws Exception{
UploadItem item = event.getUploadItem();
File f = item.getFile();
System.out.println(f.getAbsolutePath());
}
The Absolute path is to a temp directory on my computer, sure I understand that, but how would you make the file available to the webbapplication? My application is deployed as a WAR-file. Is it possible to Upload it to the WAR? Might sound stupid or so, but it might actually be handy.
I am fully aware that I can rename the file to copy it to a new location, but is that the way to go?