PrimeFaces upload with PrettyFaces enabled


To make your Primefaces upload component work together with Prettyfaces semantic URLs


Do you have an application with Primefaces’ fileUpload component that suddenly stopped working when you start using Prettyfaces to provide semantic URLs as asked in this page?

If you do, maybe this recipe suits your needs!

How to

As usual, make sure you define Primefaces upload filter in your web.xml or web-fragment.xml file. However, unlike what you usually need to do, in order to make it usable together with Prettyfaces, that filter needs to be associated to the dispatcher type “FORWARD”, as follows:

  <filter-name>PrimeFaces FileUpload Filter</filter-name>
  ... init params - not shown for simplicity reasons
  <filter-name>PrimeFaces FileUpload Filter</filter-name>
  <servlet-name>Faces Servlet</servlet-name>


Without the association of Primefaces’ filter to the “forward” dispatcher type, Prettyfaces filters do not let the upload filter from Primefaces to be able to process the request. So, if you do associate the upload filter to the forward dispatcher, the filter is now able to be invoked and process the request


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s