File upload component under prettyfaces mapped url doesn't upload anything
August 23, 2014 at 8:32 pm #26359
I’ve write a test that shows the problem in a JEE7 maven very simple application, you can clone the project using:
Can anyone help me to understand where is the problem ?
This happens on Glassfish 4 with latest mojarra library, primefaces 5 and rewrite-servlet/rewrite-integration-faces/rewrite-config-prettyfaces 2.0.12.Final
Notice that I must use PrettyFaces (can’t use rewrite module only because I must load some specific data using url parameters before page rendering…)
Many thanks in advance…August 24, 2014 at 3:03 am #26360
Hey. Could you check if the workaround from here helps:
See the “Why are file uploads not working correctly any more?” section.August 29, 2014 at 4:20 am #26368
I’ve tried but no luck, same problem…
I’ve updated my test application at: https://bitbucket.org/giates2000/testprettyfacesprimefaces5uploadproblem
Now I’ve refactored the test application dropping prettyfaces annotations and inserting rewrite configuration provider, but the problem is still there, as soon as I’m using a rewrited url fileUpload doesn’t upload anything, when the same component is used without url rewriting it correctly upload the files…
September 10, 2014 at 5:32 am #26377
- This reply was modified 2 years, 9 months ago by giates.
guys, your forum is broken.
ones cannot create topics anymore because form validation doesn’t let you. It’s always saying that the Topic must be not empty, when it is actually not empty.September 15, 2014 at 11:32 am #26390
Any news about the issue ?
Seems that the problem appears only when I’m using rewrite module…
Notice that I’ve just tested the test application (see posts above) on Glassfish v. 4.1 and the problem is still there…September 16, 2014 at 6:06 am #26391
>don’t work well in forum topics any may cause this error. Could you check that?
I don’t know about any workarounds for this issue which work on Glassfish. Sorry.
As described in the FAQ, there is really no way for Rewrite to work around this issue. Rewrite has to use methods like
HttpServletRequest.getParameter()which breaks multipart requests in some containers.
AFAIK the Tomcat workaround doesn’t work in Glassfish (although Glassfish uses Tomcat internally, right?). Wildfly in the newest version should work. Older versions have to be patched.
One thing that COULD work in Glassfish is to create a rule that basically prevents that other Rewrite rules are evaluated for the URL that contains the upload component. So you could try to add this in front of all your other rules:
.addRule() .when( Direction.isInbound().and( Path.matches( "/somepath/my-upload.jsf" ) ) ) .perform( Lifecycle.handled() )
But this means that you have a Join or anything else for this URL.
It’s just a guess. Perhaps it helps. 🙂September 24, 2014 at 5:13 pm #26398
many thanks for your response.
I’ve found a solution, if I insert commons file upload dependency to my project and set:
<context-param> <param-name>primefaces.UPLOADER</param-name> <param-value>commons</param-value> </context-param> <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>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
into web.xml I can correctly upload the files using Rewrite module on Glassfish 4.1
Probably using commons fileupload the request.getParameter of Rewrite module is working good…
You must be logged in to reply to this topic.