p:fileUpload issue

UI Components for JSF
Post Reply
yhrchan
Posts: 11
Joined: 03 Sep 2010, 17:40

02 Oct 2010, 00:15

Hi,

I have been pulling my hair trying to get p:fileUpload to work and I have been reading through posts regarding this but still haven't gotten any luck. I am using PrimeFaces 2.1 and Apache MyFaces 2.0.2 and trying to implement a simple single file upload but whenever I upload a file I am getting the following exception:

SEVERE: View State cannot be reconstructed
javax.faces.FacesException: javax.faces.application.ViewExpiredException

My tag looks like this:

<p:fileUpload fileUploadListener="#{testBean.handleFileUpload}" id="documentToUpload"
allowTypes="*.jpg;*.png;*.gif;" description="Images" update="messages" />

With the following in web.xml:

<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>/TEMP</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

and also had javax.faces.STATE_SAVING_METHOD set to "server"

Is there anyone that got this kind of setup working? or is there an existing bug in MyFaces 2.0.2???

Thanks,
Ricky

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests