p:fileUpload calls bean constructor for each file
问题 I'm trying to use <p:fileUpload> to upload a file. Here's the view: <h:form enctype="multipart/form-data"> <p:growl id="messages" showDetail="true" /> <p:fileUpload fileUploadListener="#{viewscopedBean.handleFileUpload}" mode="advanced" dragDropSupport="true" multiple="true" update="messages" /> </h:form> Bean: @ManagedBean @ViewScoped public class ViewscopedBean implements Serializable{ private List<UploadedFile> uploadedFiles; //to remember which files have been uploaded public