步骤1:xhtml表单类型
<p:fileUpload id="fileupload_Test"
fileUploadListener="#{CIM.handleFileUpload}" auto="true"
fileLimit="1" label="Select Excel File" mode="advanced"
invalidSizeMessage="File size limit exceeds.Maximum allowable size '#{CIM.xlFileSizeLimit}'MB. FileName: "
sizeLimit="100000"
allowTypes="/(\.|\/)(xls|xlsx)$/" onstart="PF('import_glasspane').block()"
oncomplete="PF('import_glasspane').unblock()" >
</p:fileUpload>
第2步:bean-listener
public void handleFileUpload(FileUploadEvent event) {
FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, message);
}
注意:在wildfly版本:10,primefaces版本6.1.11中工作正常。
问题:迁移wildfly 20后,fileupload侦听器没有调用。
暂无答案!
目前还没有任何答案,快来回答吧!