[jboss-jira] [JBoss JIRA] (WFLY-2284) HttpServletRequest.getQueryString() returns null for forwarded requests

Christian Kaltepoth (JIRA) jira-events at lists.jboss.org
Fri Oct 11 03:17:03 EDT 2013


     [ https://issues.jboss.org/browse/WFLY-2284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Kaltepoth updated WFLY-2284:
--------------------------------------

    Attachment: forward-query.zip


Project to reproduce the bug
                
> HttpServletRequest.getQueryString() returns null for forwarded requests
> -----------------------------------------------------------------------
>
>                 Key: WFLY-2284
>                 URL: https://issues.jboss.org/browse/WFLY-2284
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web (Undertow)
>    Affects Versions: 8.0.0.Beta1
>            Reporter: Christian Kaltepoth
>            Assignee: Stuart Douglas
>         Attachments: forward-query.zip
>
>
> When a request gets forwarded to another Servlet, {{HttpServletRequest.getQueryString()}} returns null, even if the original request contains query parameters.
> From Servlet 3.1 spec 9.4.1:
> {quote}
> The request dispatching mechanism is responsible for aggregating query string parameters when forwarding or including requests.
> {quote}
> The attached sample project demonstrates the problem:
> If you request {{/first?foo=bar}}, the corresponding servlet will forward the request to {{/second}}. The second servlet will get these values:
> {code}
> request.getRequestURI():      /forward-query/second
> request.getParameter("foo"):  bar
> request.getQueryString():     null
> {code}
> In JBoss AS 7.1.1  and Tomcat the result looks like this:
> {code}
> request.getRequestURI():      /forward-query/second
> request.getParameter("foo"):  bar
> request.getQueryString():     foo=bar
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list