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
You forgot to read the PrimeFaces User Guide. Here's an extract of <p:fileUpload>
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.
<filter> <filter-name>PrimeFaces FileUpload Filter</filter-name> <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class> </filter> <filter-mapping> <filter-name>PrimeFaces FileUpload Filter</filter-name> <servlet-name>Faces Servlet</servlet-name> </filter-mapping>
Without that filter, no one action method inside a <h:form enctype="multipart/form-data">
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.