FileUpload and PrettyFaces

UI Components for JSF
Post Reply
lmmoreira
Posts: 60
Joined: 08 Jul 2010, 14:15

12 Jul 2010, 20:25

Hi, I have got a FileUpload that when I put the PrettyFaces on My Application it just stop working.

I dont get an error but it stops on 0% and shows CELULARTIM.csv (6.71MB) - IO Error

On web.xml, the upload filter is the first.
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">

<session-config>
<session-timeout>
30
</session-timeout>
</session-config>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>

<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>

<context-param>
<param-name>primefaces.skin</param-name>
<param-value>none</param-value>
</context-param>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/primefaces_resource/*</url-pattern>
</servlet-mapping>

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<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>

<filter>
<filter-name>Pretty Filter</filter-name>
<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>

</web-app>
I am on JSF 2, Prime 2.1, Tomcat.

<p:fileUpload multiple="true" allowTypes="*.*" fileUploadListener="#{importacaoBilhetesController.upload}" rendered="#{importacaoBilhetesController.tipoImportacaoSelecionado != null}" update="threadstatus" image="/Imagens/browse.png" height="48" width="48" widgetVar="uploader" customUI="true" />

What is the matter. Is it a filter question?
Tomcat 7 + jsf-api - 2.0.3-SNAPSHOT + Primefaces 2.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Jul 2010, 11:38

This sounds like a compatibility issue with PrettyFaces filter.

lmmoreira
Posts: 60
Joined: 08 Jul 2010, 14:15

13 Jul 2010, 13:23

Is there a workaround to have this working or should I find another solution?

Thank you
Tomcat 7 + jsf-api - 2.0.3-SNAPSHOT + Primefaces 2.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jul 2010, 18:26

Currently I'm not aware of a workaround, do you get an error from server side on console?

lmmoreira
Posts: 60
Joined: 08 Jul 2010, 14:15

14 Jul 2010, 20:08

No Error. Thats the worst.

I tried to debug the pretty filter but it runs everytime.
Tomcat 7 + jsf-api - 2.0.3-SNAPSHOT + Primefaces 2.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

15 Jul 2010, 16:56

Author of PrettyFaces is a friend of mine so if you can find out an exception, we can forward the error to him and solve it together.

goutham.rao
Posts: 24
Joined: 29 Jan 2010, 16:27
Location: Newbury,United Kingdom

14 Aug 2010, 19:52

Hello Cagatay,lmmoreira,

Just wanted to know if this issue is being looked into( I couldn't find any issue logged, shall I log one?) Has anybody found a work around yet for this?

Cheers,
Goutham
Primefaces 2.2.1
GlassFish V3.0, JSF 2.0.3
EJB 3.1,HIbernate 3.5
Coding on Netbeans 6.9.1

ajacob
Posts: 4
Joined: 24 Jul 2012, 17:01

20 Mar 2013, 12:09

This topic is quite old but I had to make PrettyFaces (1.1.0.Final) and PrimeFaces (3.4.2) work together recently.

Be sure to add

Code: Select all

<dispatcher>FORWARD</dispatcher>
to your PrimeFaces FileUpload Filter mapping

Code: Select all

	<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>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
Source : http://ocpsoft.org/support/rewrite/jsf2 ... d-properly

Happy coding!
PrimeFaces 3.4, Glassfish 3.1.2, Firefox 15.0

coy198x
Posts: 3
Joined: 07 Jun 2013, 10:11

05 Aug 2013, 07:20

ajacob wrote:This topic is quite old but I had to make PrettyFaces (1.1.0.Final) and PrimeFaces (3.4.2) work together recently.

Be sure to add

Code: Select all

<dispatcher>FORWARD</dispatcher>
to your PrimeFaces FileUpload Filter mapping

Code: Select all

	<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>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
Source : http://ocpsoft.org/support/rewrite/jsf2 ... d-properly

Happy coding!
Thank you very much. It really help me out!

God bless you!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests