tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eriksson, Michael" <>
Subject getRequestURI after forward
Date Fri, 17 Jan 2003 15:11:51 GMT
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

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
leads the reader to believe that the original request URI is

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?



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message