虽然简单,但却无法正常工作
upload.xhtml
<p:fileUpload mode="advanced" skinSimple="true" auto="true" fileUploadListener="#{upload.fileUploadListener}" />
方法
public void fileUploadListener(FileUploadEvent e){
// Get uploaded file from the FileUploadEvent
this.file = e.getFile();
// Print out the information of the file
System.out.println("Uploaded File Name Is :: "+file.getFileName()+" :: Uploaded File Size :: "+file.getSize());
}
我的环境是
Sprintboot-2.0.2 PrimeFaces 6.x Mojarra 2.3.4 PrimeFaces扩展6.2.4