tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: HttpServletResponse.encodeURL is broken for relative URLs
Date Sun, 05 Nov 2000 03:21:07 GMT
Colin Evans wrote:

> Hi, it appears that HttpServletResponse.encodeURL refuses to add a
> JSESSIONID to relative URLs for Tomcat 3.1 and 3.2b6.  I looked at the code,
> and it appears that HttpServletResponseFacade.isEncodeable() always returns
> false on URL strings that are not fully qualified, and this causes encodeURL
> to always ignore relative URLs.
> I can't find anything in the javadoc or servlet spec saying that encodeURL
> is supposed to ignore relative URLs.  Since using relative URLs for internal
> navigation around websites is considered a standard practice, my guess is
> that encodeURL is supposed work correctly with relative URLs.  Am I mistaken
> in this?
> This is a bad bug for me; I'm writing Palm VII sites, and Palm web clippings
> don't support cookies at all, which makes HttpServletResponse.encodeURL
> important.

It is not supposed to ignore them -- it is supposed to convert them to absolute
and then add the path parameter if:
- The host and port of the absolute URL
  matches the original request
- The context path of the absolute URL
  matches the original request
  (i.e. the URL points back at this app)

I will take a look - but in the past, this has seemed to work correctly.

> Thanks!
> -Colin


> --
> Colin Evans
> Bitmo, Inc. (
> (415)920.7225 /
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message