You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/11/03 02:41:35 UTC
DO NOT REPLY [Bug 28222] -
getRequestURL() in forwarded jsp/servlet doesn't return new url
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28222>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28222
------- Additional Comments From jan.luehe@sun.com 2005-11-03 02:41 -------
I just filed Issue 26 ("[javadocs] HttpServletRequest.getRequestURL()
does not consider RD.forward() scenario") with the Servlet EG, see
https://servlet-spec-eg.dev.java.net/issues/show_bug.cgi?id=26,
with the following description:
======================================================================
The javadocs of javax.servlet.http.HttpServletRequest.getRequestURL()
have been misleading and causing confusion among developers.
See http://issues.apache.org/bugzilla/show_bug.cgi?id=28222,
Synopsis: "getRequestURL() in forwarded jsp/servlet doesn't return new url",
for details.
I am proposing the following clarification to the javadocs of
javax.servlet.http.HttpServletRequest.getRequestURL():
Index: HttpServletRequest.java
===================================================================
RCS file:
/cvs/glassfish/servlet-api/src/jakarta-servletapi-5/jsr154/src/share/javax/servlet/http/HttpServletRequest.java,v
retrieving revision 1.2
diff -u -r1.2 HttpServletRequest.java
--- HttpServletRequest.java 16 Aug 2005 02:02:08 -0000 1.2
+++ HttpServletRequest.java 1 Nov 2005 18:31:11 -0000
@@ -535,6 +535,11 @@
* number, and server path, but it does not include query
* string parameters.
*
+ * <p>If this request has been forwarded using
+ * {@link javax.servlet.RequestDispatcher#forward}, the server path in the
+ * reconstructed URL must reflect the path used to obtain the
+ * RequestDispatcher, and not the server path specified by the client.
+ *
* <p>Because this method returns a <code>StringBuffer</code>,
* not a string, you can modify the URL easily, for example,
* to append query parameters.
===================================================================
We still have a small window of opportunity where clarifications of this kind
may be added to the Servlet 2.5 spec.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org