You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Phil Hanna <Ph...@sas.com> on 2000/05/24 21:46:35 UTC

RE: Partial fix for URL rewriting bug in HttpServletResponseFacad e.java

But do web servers recognize such a URI?  I try it with Apache 1.3.12 and it fails, even though index.jsp exists:

GET /index.jsp;jsessionid=1234 HTTP/1.0

HTTP/1.1 404 Not Found
Date: Wed, 24 May 2000 19:43:16 GMT
Server: Apache/1.3.12 (Win32) tomcat/1.0
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL /index.jsp;jsessionid=1234 was not found on this server.<P>
<HR>
<ADDRESS>Apache/1.3.12 Server at xxxx.xx.xx.com Port 80</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.

-----Original Message-----
From: Hans Bergsten [mailto:hans@gefionsoftware.com]
Sent: Wednesday, May 24, 2000 3:43 PM
To: tomcat-dev@jakarta.apache.org
Subject: Re: Partial fix for URL rewriting bug in
HttpServletResponseFacade.java


Phil Hanna wrote:
> [...]
> Note: This doesn't fix the encodeURL() problem that occurs when cookies are 
> turned off.  Is there some reason why the jsessionid is encoded with ";" 
> instead of "?"?  JRun treats the session ID parameter like any other parameter, 
> and it seems to work fine.

The reason is that jsessionid is a "path parameter" (the term used in the HTTP
spec) as opposed to a regular query string parameter, exactly as specified in
the Servlet 2.2 spec. Using a query string parameter for the session ID doesn't
work in all cases, such as if you encode the URL for a <img src> tag and use an
image map (some browsers just adds "?x=12&y=34" query string params, creating an
invalid URL like "/myimage.gif?jsessionid=1234?x=12&y=34"), or when you encode
a URL like "/foo.jsp?foo=bar" (ends up as "/foo.bar?jsessionid=1234?foo=bar").

JRun is, in other words, wrong. I sent them a bug report about this a while
back but I'm not sure if it's fixed in JRun 3.0.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

RE: Partial fix for URL rewriting bug in HttpServletResponseFacad e.java

Posted by co...@costin.dnt.ro.
> But do web servers recognize such a URI?  I try it with Apache 1.3.12 and it fails, even though index.jsp exists:
> 
> GET /index.jsp;jsessionid=1234 HTTP/1.0

Use mod_jk - mod_jserv doesn't handle that ( it has support for URL
rewriting, but with a different mechansim, different from  2.2 spec ).

Costin