Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Apache2, Tomcat5.5, mod_jk and HTTP content-type

Joe Pemberton

2007-01-29

Replies:

I'm trying to connect Apache2 with mod_jk to Tomcat5.5.

Almost everything seems to work. However, if I have cookies disabled,
Tomcat will rewrite all urls to include ;jsessionid=XXXXXXXXX (which is I
want and expect). Unfortunately, it seems as though Apache2 insists on
determining the content-type of the response based on the extension of the
file requested. This means that:

if i request "/myservlet/index.html"
I get "Content-Type: text/html; charset=UTF-8"

if i request "/myservlet/index.html;jsessionid=12341243123412341234"
I get "Content-Type: text/plain; charset=UTF-8"

Obviously, this is a problem. I looked through the apache docs and the
mod_jk docs, but I didn't find a way to disable this behavior. I could
possibly set the DefaultType directive to "text/html", but this would leave
.gif/.jpg/.css/etc broken.

I also didn't find much through google. Any pointers would be greatly
appreciated.

-Joe
©2008 junlu.com - Jax Systems, LLC, U.S.A.