You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Eriksson, Michael" <Mi...@bauer-partner.com> on 2003/01/17 16:11:51 UTC

getRequestURI after forward

Hallo Remy,

I have noted that request.getRequestURI in an error page
delivers the URI of the request page whereas getRequestURL
refers to the originally called resource. This is probably
the same (much more general) case described in
http://issues.apache.org/bugzilla/show_bug.cgi?id=8409.

This bug report was marked as invalid by you with the
indication that getRequestURI delivers a path element, which
according to section 8.4 in the servlet spec should be
altered accordingly when forwarding.

I am not quite sure if this interpretation is true. For one
thing section 4.4 (request path elements) explicitly lists
the methods accessing path elements
(getContextPath/ServletPath/PathInfo), but makes no mention
of getRequestURI.

It does however say:
requestURI = contextPath + servletPath + pathInfo

Further the corresponding java doc comment
(http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletRequest.html#getRequestURI())
leads the reader to believe that the original request URI is
meant.

My interpretation would be that requestURI as an abstract
concept should be considered a path element that changes
with a forward. However, the _method_ getRequestURI should
(strangely inconsistent) deliver the pre-forward value.

What is your take on this?


GrĂ¼sse,

Michael

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>