You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2009/06/09 20:22:07 UTC

[jira] Resolved: (TOMAHAWK-1108) MultipartRequestWrapper doesn't handle request parameters correctly in JSF 1.2/JSP 2.1

     [ https://issues.apache.org/jira/browse/TOMAHAWK-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved TOMAHAWK-1108.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.9-SNAPSHOT
         Assignee: Leonardo Uribe

I reviewed the patch and it works. I did some small modifications and comments. 

Definitively it is clear that the assumption that query params are the same from start of the request is wrong, because the user can use jsp:include + jsp:param to add "query params". But note that the params decoded when the request is parsed takes precedence over request.getParameterMap, because this ones are "content" parameters.

> MultipartRequestWrapper doesn't handle request parameters correctly in JSF 1.2/JSP 2.1
> --------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1108
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1108
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.6
>         Environment: RI 1.2.1, tomahawk 1.1.6, Tomcat 6.0.14, Java 1.5
>            Reporter: Ben Smith
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.9-SNAPSHOT
>
>         Attachments: MultipartRequestWrapper.java, TOMAHAWK-1108.patch
>
>
> The getParameter*() methods of MultipartRequestWrapper don't work correctly in Tomcat 6/JSP 2.1(at least).  I think the problem applies to parameters in an included file, but it may apply in other places, too.  To reproduce the problem, create a jsp file that includes another jsp file and uses <jsp:param /> to pass a parameter to the included file.  When the extension filter is "active" (i.e. a form with enctype=multipart/form-data" is submitted), the parameter will not be available in the included file.
> The problem is that MultipartRequestWrapper only parses the request once, so it doesn't pick up the new request parameters in the included file.
> I was able to fix the problem by modifying parseRequest() to only retrieve the FileItem parameters and then the getParameter*() methods to call through to the wrapped request getParameter*() as necessary.
> I don't know enough about all of this to know whether or not my fix is the right way to do it but I'll attach my version of MultipartRequestWrapper.java

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.