简体   繁体   English

fileupload primefaces 5.0在高级模式下不起作用

[英]fileupload primefaces 5.0 does not work in advanced mode

I'm trying to upload files with the fileupload in primefaces 5.0, it works in the simple mode but it does not in the advanced mode. 我正在尝试使用primefaces 5.0中的fileupload上传文件,它在简单模式下工作,但它不在高级模式下。 When I choose a file to upload it the two buttons upload button and cancel button still disabled, I've searshed for a solution on the net but I found nothing. 当我选择一个文件来上传它时,两个按钮上传按钮和取消按钮仍然被禁用,我已经在网上搜索解决方案,但我什么都没发现。 please help. 请帮忙。

 <h:form>
    <p:fileUpload fileUploadListener="#{fileUpload.handleFileUpload}" 
                  mode="advanced" dragDropSupport="false"
                  update="messages" sizeLimit="100000" fileLimit="3" 
                  allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />

    <p:growl id="messages" showDetail="true" />
</h:form>
@ManagedBean

public class FileUpload{

    public void handleFileUpload(FileUploadEvent event) {
        FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
        FacesContext.getCurrentInstance().addMessage(null, message);
    }
}

This Primefaces 5 spec. 这个Primefaces 5规格。 You must have these versions of jars, then It will work 你必须有这些版本的罐子,然后它会工作

  1. JSF runtime 2.0, 2.1 or 2.2 JSF运行时2.0,2.1或2.2
  2. itext 2.1.7 itext 2.1.7
  3. apache poi 3.7 apache poi 3.7
  4. rome 1.0 罗马1.0
  5. commons-fileupload 1.3 commons-fileupload 1.3
  6. commons-io 2.2 commons-io 2.2
  7. atmosphere 2.1.3 气氛2.1.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM