How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable

前端 未结 10 2363
孤独总比滥情好
孤独总比滥情好 2020-11-21 05:04

I\'m trying to upload a file using PrimeFaces, but the fileUploadListener method isn\'t being invoked after the upload finishes.

Here is the view:

10条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 05:09

    Neither of the suggestions here were helpful for me. So I had to debug primefaces and found the reason of the problem was:

    java.lang.IllegalStateException: No multipart config for servlet fileUpload
    

    Then I have added section into my faces servlet in the web.xml. So that has fixed the problem:

    
        main
    
            org.apache.myfaces.webapp.MyFacesServlet
            1
            
                /tmp
                20848820
                418018841
                1048576
            
        
    

提交回复
热议问题