So i have seen several questions about similar issues, anyway i cannot fix my problem.
I want to use primefaces' fileUpload functionality to upload multiple files. So i have this in my xhtml. I built it based on the instructions here: How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null
xhtml:
<h:form enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{controller.upload}" multiple="true"></p:fileUpload>
</h:form>
Note:
- upload is within a h:form tag
- enctype is set to multipart/form-data
- I use "advanced" mode, and the
<h:head>
tag exists.
Configuration:
- I use JSF2.2 and Primefaces 5.2, therefore i did not add additional configuration, as suggested in the post
My Bean:
@ManagedBean
@RequestScoped
public class controller implements Serializable {
public void upload(FileUploadEvent event) throws IOException{
//Do something
}
Note:
- I did it as suggested in the post for ajax-uploads.
Troubleshooting:
- as i do not use the PrimeFaces file upload filter, suggestion 1 and 2 do not apply
- i do not have a nested h:form
- Checking traffic in browser: A Post request is being performed and i get Ok 200.
Further, the post states that the Request can only be parsed once (in relation to filter chain ordering). I have 2 (additional) active filter chains, spring security and pretty faces. Can one of those be the problem here?
Update: PrettyFaces seems, indeed, to be the cause of the problem. When disabling it, everything works.