關於ice:fileinput的問題

問題已經解決,但仍不知道原因。通過設置絕對路徑,使得上傳文件得以實現:

 <context-param>
<param-name>com.icesoft.faces.uploadDirectory</param-name>
<param-value>C:\Uploads</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.uploadDirectoryAbsolute</param-name>
<param-value>true</param-value>
</context-param>


以及:

 public void essaiDeplacer(ActionEvent event){
String id = ((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getId();

InputFile inputFile =(InputFile) event.getSource();
//file has been saved
if (inputFile.getStatus() == InputFile.SAVED) {
String fileName = inputFile.getFileInfo().getFileName();
System.err.println("filename = "+fileName);
File source = new File("c:\\Uploads\\"+id+"\\"+fileName);
File destination = new File("c:\\Uploads\\"+fileName);
source.renameTo(destination);
}
}



引自:[url]http://www.icefaces.org/JForum/posts/list/8293.page[/url]