[jboss-jira] [JBoss JIRA] (WFLY-4070) Dispatcher modifies result of getRequestURI of the original request object
Patson Luk (JIRA)
issues at jboss.org
Wed Jun 24 19:02:02 EDT 2015
[ https://issues.jboss.org/browse/WFLY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13083566#comment-13083566 ]
Patson Luk commented on WFLY-4070:
----------------------------------
Hi [~swd847],
Thanks for pointing out the index.jsp as welcome file behavior, yes it indeed bypassed the dispatcher.
Therefore, I have updated the code (attachments updated) to better demonstrate the issue. Changes made:
1. Added a output line in TestDispatcher.java to display the request URI (also to ensure the dispatcher is executed)
2. Renamed index.jsp to test.jsp, such that it will not be treated as the welcome file
3. Changed in TestDispatcher.java to forward to test.jsp instead
If we access the root of the endpoint, for example http://localhost:8080/test-wildfly/, it should print in the console the request URI before the forwarding in TestDispatcher.java and the request URI just before exiting the filter TestFilter.java
I have tested on Tomcat 8, JBoss AS 7.1.1.Final, JBoss 8.1.0.Final and JBoss 9.0.0.CR2 (latest GA release) and below is the output:
Tomcat 8
Running dispatcher with requested URI as : /test-wildfly/
Finished processing request with requested URI as : /test-wildfly/
JBoss as 7.1.1.Final
15:36:54,607 ERROR [stderr] (http--0.0.0.0-8080-1) Running dispatcher with requested URI as : /test-wildfly/
15:36:55,413 ERROR [stderr] (http--0.0.0.0-8080-1) Finished processing request with requested URI as : /test-wildfly/
JBoss 8.1.0.Final
15:37:46,300 ERROR [stderr] (default task-2) Running dispatcher with requested URI as : /test-wildfly/
15:37:47,112 ERROR [stderr] (default task-2) Finished processing request with requested URI as : /test-wildfly/test.jsp
JBoss 9.0.0.CR2
15:45:27,652 ERROR [stderr] (default task-7) Running dispatcher with requested URI as : /test-wildfly/
15:45:27,655 ERROR [stderr] (default task-7) Finished processing request with requested URI as : /test-wildfly/test.jsp
It appears that JBoss 9.0.0.CR2 still has the modified URI and does not exhibit the same behavior as Tomcat 8 and JBoss as 7.
Many thanks for your attention!
> 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.war, test-wildfly.zip, 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.15#6346)
More information about the jboss-jira
mailing list