[jboss-jira] [JBoss JIRA] (WFLY-4070) Dispatcher modifies result of getRequestURI of the original request object
Patson Luk (JIRA)
issues at jboss.org
Wed Nov 12 13:21:29 EST 2014
[ https://issues.jboss.org/browse/WFLY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019507#comment-13019507 ]
Patson Luk edited comment on WFLY-4070 at 11/12/14 1:21 PM:
------------------------------------------------------------
Thanks for the quick reply!
Yes I have tested on both Tomcat 7 and JBoss as 7 - both retain the the originating URI on the original Servlet Request object after dispatcher forwards. This can be easily reproduce by deploying the war attachment to those app servers
Access the root of the application the below will be triggered:
1. TestFilter gets executed as it has @WebFilter(urlPatterns = "/*"), it calls next filter in chain
2. No other filters, so TestDispatcher is executed as it has @WebServlet("/"). The servlet obtains requestDispatcher on "index.jsp" and then forwards the request with it
3. index.jsp is a simple page with static text
4. Goes back to TestFilter, which outputs the request.getRequestURI to System.out. Take note that the request object is the original Servlet Request object passed into the filter's doFilter method
On Tomcat 7 and JBoss as-7, both display:
Finished processing request with requested URI as : /test-wildfly/
On Wildfly:
Finished processing request with requested URI as : /test-wildfly/index.jsp
was (Author: pluk):
Thanks for the quick reply!
Yes I have tested on both Tomcat 7 and JBoss as 7 - both retain the the originating URI on the original Servlet Request object after dispatcher forwards. This can be easily reproduce by deploying the war attachment to those app servers
Access the root of the application the below will be triggered:
1. TestFilter gets executed as it has @WebFilter(urlPatterns = "/*") it calls next filter in chain
2. No other filter, so TestDispatcher is executed as it has @WebServlet("/"). The servlet get requestDispatcher on index.jsp and then forward the request
3. Goes back to TestFilter, which it output the request.getRequestURI to the System.out. Take note that the request object is the original request object passed into the filter's doFilter method
On Tomcat 7 and JBoss as-7, both display:
Finished processing request with requested URI as : /test-wildfly/
On Wildfly:
Finished processing request with requested URI as : /test-wildfly/index.jsp
> Dispatcher modifies result of getRequestURI of the original request object
> --------------------------------------------------------------------------
>
> Key: WFLY-4070
> URL: https://issues.jboss.org/browse/WFLY-4070
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 8.1.0.Final, 9.0.0.Alpha1
> Reporter: Patson Luk
> Assignee: Stuart Douglas
> Attachments: test-wildfly.war, test-wildfly.zip
>
>
> This is actually similar to https://issues.jboss.org/browse/WFLY-2388, which was fixed in 8.0.0.CR1
> However, it seems like with RequestDispatcher forward, the ORIGINAL ServletRequest object's getRequestURI returns the forwarded URI as the result, which is not correct. It is expected that the original ServletRequest object should retain its originating requested URI throughout the processing.
> This seems to affect all the versions of Wildfly (tested on 8.1 and 9.0 alpha)
> Take note that this has also been tested on JBoss AS 7 and tomcat 7, both have correctly retained the originating URI as expected even after dispatcher forwards
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
More information about the jboss-jira
mailing list