Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

primefaces fileupload doesn't work

 
yun hu
Greenhorn
Posts: 13
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody use p:fileUpload no problem?

I have problem when i click upload button. It doent go into the managedBean action.

here is my code.

xhtml:<h:form id="mainform" prependId="false" enctype="multipart/form-data">
<p:fileUpload id="test"
fileUploadListener="#{commonBean.handleFileUpload}"
allowTypes="*.jpg;*.png;*.gif;" description="Images" />
</h:form>

managedBean:
public void handleFileUpload(FileUploadEvent event) {
System.out.println(event.getFile().getFileName());
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic