Primefaces p:fileUpload doesn't work with Portlet Bridge 3.2.0.Final in JBoss GateIn portlet container.
jalxm Apr 29, 2013 7:29 AMPrimefaces file upload component p:fileUpload doesn't work with portlet container GateIn.
I created portlet with JSF2 + Primefaces
<h:form id="form" enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{editController.handleFileUpload}"
mode="advanced"
sizeLimit="100000"/>
</h:form>
In FireBug I see that post with file successfully send to server but no listener call in ManagedBean.
In web.xml
<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> |
<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>*.jsf</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>Faces Servlet</servlet-name> | |
<url-pattern>*.faces</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>Faces Servlet</servlet-name> | |
<url-pattern>*.xhtml</url-pattern> | |
</servlet-mapping> |
In portlet.xml
<portlet> | ||||
<portlet-name>MyEdit</portlet-name> | ||||
<portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class> | ||||
<init-param> | ||||
<name>javax.portlet.faces.defaultViewId.view</name> | ||||
<value>/edit.xhtml</value> | ||||
</init-param> | ||||
<init-param> | ||||
<name>javax.portlet.faces.defaultViewId.edit</name> | ||||
<value>/pref_edit.xhtml</value> | ||||
</init-param> | ||||
<supports> | ||||
<mime-type>text/html</mime-type> | ||||
<portlet-mode>VIEW</portlet-mode> | ||||
<portlet-mode>EDIT</portlet-mode> | ||||
</supports> | ||||
<portlet-info> | ||||
<title>My Edit Portlet</title> | ||||
</portlet-info> | ||||
<security-role-ref> | ||||
<role-name>administrator</role-name> | ||||
<role-link>administrators</role-link> | ||||
</security-role-ref> | ||||
<security-role-ref> | ||||
<role-name>user</role-name> | ||||
<role-link>users</role-link> | ||||
</security-role-ref> | ||||
</portlet> |
Environment: GateIn-3.5.0.Final-tomcat7, Primefaces 3.5, Portlet-Bridge 3.2.0.Final
Dependencies in pom.xml
<dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.1.7</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.7</version> </dependency> <dependency> <groupId>com.sun.facelets</groupId> <artifactId>jsf-facelets</artifactId> <version>1.1.14</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>3.5</version> </dependency> <!-- portlets --> <dependency> <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.portletbridge</groupId> <artifactId>portletbridge-api</artifactId> <version>3.2.0.Final</version> </dependency> <dependency> <groupId>org.jboss.portletbridge</groupId> <artifactId>portletbridge-impl</artifactId> <version>3.2.0.Final</version> <scope>runtime</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <scope>provided</scope> <version>2.1</version> </dependency>
I found workaround for Liferay portlet container http://code.google.com/p/primefaces/issues/detail?id=2905
And Richfaces provide support for this issue
<dependency>
<groupId>org.jboss.portletbridge</groupId>
<artifactId>portletbridge-extension-richfaces</artifactId>
<version>3.2.0.Final</version>
<scope>runtime</scope>
</dependency>
But I didn't find anything for Primefaces.
Could you help?