I have checked web sites, FAQs and previous posts, but can't find a
satisfactory answer to my particular problem. I am having trouble getting
Apache 2 and Tomcat 5 (connected with mod_jk2.so) when Apache encounters
URLs with the jsessionid set explicitly in the URI.

When cookies are disabled in a web browser, Tomcat correctly adds the
jsessionid to all outgoing references to other assets (images, other pages)
within a page. Thus a URI

http://mydom/myapp/mypage.jsp
becomes
http://mydom/myapp/mypage.jsp;jsessionid=(32 characters)

Which is fine for JSPs because I want Tomcat to serve JSPs. But for images

http://mydom/myapp/images/image.gif
becomes
http://mydom/myapp/images/image.gif;jsessionid=(32 characters)

I want Apache to serve this, but Apache gives a 404 Error because it doesn't
understand how to process the jsessionid, or more specifically it doesn't
know how to deal with the semi-colon

I have seen a solution that offers:

<IfModule mod_rewrite.c>
 RewriteEngine     on
 # Force URLs with a jsessionid to go to Tomcat. Necessary because
 # Apache doesn't recognise that the semi-colon is special.
 RewriteRule       ^(/.*;jsessionid=.*)$   $1 [T=jserv-servlet]
</IfModule>

But I think this is an old solution, and I am woking with the jk2_module

I have this problem for GIF and JPEG files, and also URIs such as

http://mydom/myapp/myfolder/
which become
http://mydom/myapp/myfolder/;jsessionid=(32 characters)

I have DirectoryIndex set to index.jsp, which works fine when jsessionid
isn't appended. But when jsessionid is appended, I get another 404 from
Apache.

I have the following solution, which feels entirely hacked:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteRule ^(.*\.gif);jsessionid=.*$ $1 [PT]
 RewriteRule ^(.*\.jpg);jsessionid=.*$ $1 [PT]
 RewriteRule ^(.*)/(;jsessionid=.*)$ $1/index.jsp$2 [PT]
</IfModule>

This strips off the jsessionid from GIF and JPEG files, and inserts the
index.jsp page name when it encounters a slash followed by a jsessionid.
Apache can now serve these files, but this is really horrible.

I believe that I should be able to specify something in workers2.properties
to tell Tomcat to incercept and process anything with a jsessionid in the
URL. Or I might be able to come up with something in httpf.conf that's a bit
prettier than this.

Anyone got a solution for this conundrum?
Thanks in advance.
Dave Small

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.734 / Virus Database: 488 - Release Date: 04/08/2004



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

Reply via email to