tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Bremford" <mi...@paperx.com>
Subject mod_rewrite again
Date Fri, 08 Sep 2000 15:36:57 GMT
Hi all

I've been trying to work out exactly why mod_rewrite and tomcat aren't
co-operating (please excuse my first attempt at a fix, forwarded by Michael
Percy this morning).

When I used to run Apache/JServ, this worked fine - getRequestURI() would
return the URI as requested by the user, and getServletPath() would give the
rewritten path for the servlet.

This was fine, but then the Servlet spec 2.2 came out and started insisting
that

  "requestURI = contextPath + servletPath + pathInfo".

My problem is that I cannot for the life of me see how mod_rewrite (or it's
equivalent on any other webserver) can continue to work as before. Sure, we
can pass the rewritten URI in as the requested URI, but then there is no way
of finding out  the initial URI that was requested .

If we remove the requirement to see the physical path from within the
servlet, it becomes easier. I haven't worked with Tomcat's source before,
but it looks like adding a "rewrittenURI" to the AJP12RequestAdapter class
(haven't tried AJP13 yet) and adding a new RequestInterceptor is the right
way to do it. Is this correct? I'll take a stab at writing it if necessary.

Cheers... Mike


Mime
View raw message