[
https://issues.jboss.org/browse/WFLY-2284?page=com.atlassian.jira.plugin....
]
Stuart Douglas resolved WFLY-2284.
----------------------------------
Fix Version/s: 8.0.0.CR1
Resolution: Done
HttpServletRequest.getQueryString() returns null for forwarded
requests
-----------------------------------------------------------------------
Key: WFLY-2284
URL:
https://issues.jboss.org/browse/WFLY-2284
Project: WildFly
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Web (Undertow)
Affects Versions: 8.0.0.Beta1
Reporter: Christian Kaltepoth
Assignee: Stuart Douglas
Fix For: 8.0.0.CR1
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