FileUpload Primefaces 3.0M1 + Spring Webflow

UI Components for JSF
ufasoli
Posts: 42
Joined: 05 May 2010, 19:55

11 May 2011, 17:11

Hi,
I was wondering if it was possible to use Primefaces 3 fileUpload component with Spring Webflow 2.3.0

Here is the code used to upload the file

Code: Select all

 <h:form id="form2" prependId="false" enctype="multipart/form-data" >          
            
            <p:fileUpload id="uploadJRXML2" allowTypes="jrxml"
                            description="Fichiers Jasper Report"                            
                          
                            auto="true" label="#{msg.browse}"
                            fileLimit="10"
                            mode="advanced"
                            sizeLimit="100000"
                             widgetVar="monUploader"
                               fileUploadListener="#{fileUploadHandler.handleFileUpload}"
                             update="dummy"                            
                            />
                    <p:outputPanel id="dummy"></p:outputPanel>
                   </h:form>



And here is my fileUploadHandler :

Code: Select all



@Component
public class FileUploadHandler {

	private UploadedFile uploadedFile;
	
	public void handleFileUpload(FileUploadEvent ev){
		
		System.out.println("file upload called");
	}
	
}


Here is my web.xml

Code: Select all


web-app version="3.0" 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">
	<!-- The master configuration file for this Spring web application -->
	<!-- Context Configuration locations for Spring XML files -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath*:spring/springmvc-parent.xml
		</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
		
	<!-- Jasper report -->
	<servlet>
		<servlet-name>ImageServlet</servlet-name>
		<servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>ImageServlet</servlet-name>
		<url-pattern>/servlets/image</url-pattern>
	</servlet-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>springMVCServlet</servlet-name>
	</filter-mapping>
	<filter>
		<filter-name>gzipFilter</filter-name>
		<filter-class>net.sf.ehcache.constructs.web.filter.GzipFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>gzipFilter</filter-name>
		<url-pattern>*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>shallowEtagHeaderFilter</filter-name>
		<filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>shallowEtagHeaderFilter</filter-name>
		<url-pattern>*</url-pattern>
	</filter-mapping>
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<servlet-name>springMVCServlet</servlet-name>
	</filter-mapping>
The Request goes through the Primefaces Upload filter, but the method on the backing bean (handleFileUpload) never gets called.

I tried the fileUpload simple mode but the result is the same..

This worked with Primefaces 2.2.1 but I need the HTML5 version as the Apache server has now HTTPS enabled


Any Ideas ??

thanks in advance

Using :
Mojarra 2.0.5
Primefaces 3.0M1
Spring Webflow 2.3.0
Apache Tomcat 7

dabiddd
Posts: 6
Joined: 02 Jun 2011, 16:36

13 Jun 2011, 12:10

Hi, do you solve this question?

thanks

ufasoli
Posts: 42
Joined: 05 May 2010, 19:55

13 Jun 2011, 14:06

Hi, no I had to downgrade to primefaces 2.2.1 in order to get it working.

User avatar
blind3r
Posts: 11
Joined: 17 Nov 2010, 17:33

22 Jun 2011, 16:48

I'm facing the same problem. I've searched the entire internet and this forum and no answer.

There are a lot of dumb questions being answered in this forum but apparently this legit question is not worth the effort. Not even to say it doesn't work...
Using PrimeFaces v3.0, JSF Mojarra 2.0.6 and Tomcat 6

wing2005hk
Posts: 4
Joined: 27 Jun 2011, 09:02

28 Jun 2011, 05:00

I have same problem and I saw some error from firefox web console. "Error in parsing value for 'filter'. Declaration dropped"
[10:51:58.525] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 16ms]
--
[10:52:03.893] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 31ms]
[10:52:03.909] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 31ms]
[10:52:06.653] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 16ms]
[10:52:06.657] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 16ms]
--
[10:52:12.257] POST http://localhost:8082/Photrix/photrix/u ... ution=e3s1 [HTTP/1.1 200 OK 47ms]
[10:52:12.263] POST http://localhost:8082/Photrix/photrix/u ... ution=e3s1 [HTTP/1.1 200 OK 31ms]
[10:52:12.710] GET http://localhost:8082/Photrix/photrix/u ... ution=e5s1 [HTTP/1.1 200 OK 31ms]
[10:52:12.752] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 15ms]
[10:52:12.759] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 15ms]
[10:52:12.767] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 15ms]
[10:52:12.774] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 31ms]
[10:52:12.781] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 62ms]
[10:52:12.788] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 62ms]
[10:52:12.796] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 31ms]
[10:52:12.802] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 62ms]
[10:52:12.810] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 62ms]
[10:52:12.862] Error in parsing value for 'filter'. Declaration dropped. @ http://localhost:8082/Photrix/photrix/j ... NAPSHOT:37
[10:52:12.878] Error in parsing value for 'filter'. Declaration dropped. @ http://localhost:8082/Photrix/photrix/j ... NAPSHOT:25
[10:52:12.885] Error in parsing value for 'filter'. Declaration dropped. @ http://localhost:8082/Photrix/photrix/j ... NAPSHOT:20
[10:52:12.896] Error in parsing value for 'filter'. Declaration dropped. @ http://localhost:8082/Photrix/photrix/j ... NAPSHOT:22
[10:52:12.903] Unknown property 'zoom'. Declaration dropped. @ http://localhost:8082/Photrix/photrix/j ... NAPSHOT:83

[10:52:12.984] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 15ms]
[10:52:15.283] GET http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT [HTTP/1.1 304 Not Modified 0ms]

wing2005hk
Posts: 4
Joined: 27 Jun 2011, 09:02

28 Jun 2011, 05:08

And IE show
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 28 Jun 2011 03:06:43 UTC


Message: 'null' is null or not an object
Line: 378
Char: 5
Code: 0
URI: http://localhost:8082/Photrix/photrix/j ... 2-SNAPSHOT

mhhorowi
Posts: 7
Joined: 26 Apr 2011, 04:47

28 Jun 2011, 08:05

I was able to get it to call the backing bean method but the file is empty. I am using spring webflow security as well. I've tried 2.2.1 and 3.0M1 with the same results. I have only tried firefox.

mhhorowi
Posts: 7
Joined: 26 Apr 2011, 04:47

28 Jun 2011, 17:32

I was actually get the file. I did not realize the implementation was using a Deferred file type to pin the file into memory based on the size. The file upload is working fine with primefaces 2.2.1, SWF and Tomcat. I haven't tried WLS yet.

ufasoli
Posts: 42
Joined: 05 May 2010, 19:55

28 Jun 2011, 18:03

yes it works witth 2.2.1 but it's broken on 3.0

wing2005hk
Posts: 4
Joined: 27 Jun 2011, 09:02

30 Jun 2011, 06:20

I think Primefaces 3.0.X not fully integrate with Spring Web-flow 2.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests