如何使用PrimeFaces p:fileUpload?侦听器方法从未被调用
fileUploadListener
<h:form> <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}" mode="advanced" update="messages" sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/> <p:growl id="messages" showDetail="true"/></h:form>
@ManagedBean@RequestScopedpublic class FileUploadController { public void handleFileUpload(FileUploadEvent event) { FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, msg); }}
mode="simple"
ajax="false"
牧羊人nacy
一只萌萌小番薯
Helenr
相关分类