On Wed, 10 Jul 2002, Struts Newsgroup wrote:

> Date: Wed, 10 Jul 2002 14:10:02 -0700
> From: Struts Newsgroup <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: html:base misunderstood, broken, or misleading?
>
> Subject: Re: html:base misunderstood, broken, or misleading?
> From: Eric Rizzo <[EMAIL PROTECTED]>
>  ===
> Craig R. McClanahan wrote:
> > This sounds like a bug in Jetty.
> >
> > The Struts code that computes the URL simply calls
> > request.getRequestURI().  After a forward, this is supposed to give you
> > the request URI of the resource you forwarded to (i.e. the JSP page).  It
> > looks like Jetty is still returning you the URI of the original request,
> > which is a violation of the servlet spec -- for Servlet 2.3, it's in
> > Section 8.4:
> >
> >     "The path elements of the request object exposed to
> >     the target servlet must reflect the path used to obtain
> >     the RequestDispatcher."
> >
> > You should forward this note to the Jetty developers -- they are very
> > responsive, especially on spec related issues.
>
> Indeed they are.  Greg wilkins replied to my inquiry (in which I quoted
> your spec reference) with the following:
>
> "I think that the "path elements" refer to getContextPath,
> getServletPath and getPathInfo.  I believe that getRequestURI
> should always return the URI of the original request, unless
> wrapped by a user.
>
> However!!!  Craig McClanahan know a thing or two about servlets
> so I'll go do some checking again!
>
> Jetty used to change the getRequestURI result after a forward, but
> we changed it.  From memory, I think that a watchdog test is checking for
> this....  but I'll check????
>
> Note that this is a simple enough thing to fix IF it is wrong???"
>

It's not wrong.  Changing Struts would break Struts on every other
container in the world.

>
> So he's going to do some more research.  But do you have any more info
> about what the term "path elements" means, exactly, in the spec?
> In any case, either Tomcat 3.2 (haven't tested with Tomcat 4 yet) or
> Jetty is wrong, or the spec is ambiguous (even worse of a problem).
>

Per Section 4.4 (servlet 2.3), the request path elements are context path,
servlet path, and path info.  However, if you don't also change request
URI on a forward, you violate the following paragraph (also in 8.4):

    "It is important to note that, except for URL encoding
    differences, the following equation is always true:

    requestURI = contextPath + servletPath + pathInfo"

so there's no choice about updating requestURI as well.


>       Eric

Craig


> --
> Eric Rizzo
> Software Developer
> Jibe, Inc.
> http://www.jibeinc.com
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to