primeFaces : fileUpload to byte[]

前端 未结 1 1909
一向
一向 2021-01-14 02:09

I am trying to get the uploaded image of as byte[] and persist it in DB by JPA. But I\'m facing a problem and I\'m not even su

1条回答
  •  粉色の甜心
    2021-01-14 02:56

    You forgot to read the PrimeFaces User Guide. Here's an extract of chapter:

    Getting started with FileUpload

    First thing to do is to configure the fileupload filter which parses the multipart request. FileUpload filter should map to Faces Servlet.

    
        PrimeFaces FileUpload Filter
        org.primefaces.webapp.filter.FileUploadFilter
    
    
        PrimeFaces FileUpload Filter
        Faces Servlet
    
    

    Without that filter, no one action method inside a can be invoked nor will the submitted data be properly parsed.

    As to the warning that the method cannot be found, this is related to the IDE which you're using which is pretending to be smarter than it is. Disable EL validation in that IDE to avoid those confusing warnings and look if you can't upgrade the IDE.

    0 讨论(0)
提交回复
热议问题