tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Request Processing by Apache httpd for Tomcat
Date Mon, 12 Jul 2010 16:03:07 GMT
Michael Powe wrote:
> Hello,
> I am working on an Apache module.  The module is installed in an
> Apache http server that handles requests for a Tomcat server.  When
> requests come from a mobile device, the jsessionid parameter is
> appended to the URI in the usual manner, e.g.
> /i/n_my_page.jsp;jsessionid=123adsfadsfsadf
> The above is how the URI appears in the apache server log file.
> My question is, Is this how the URI is stored in the request_rec
> object?  I need to apply some logic based on the value of the URI
> stored in request_rec, so I want to be sure I understand how this
> value is created when Apache is running in front of Tomcat.
I think that you are in the wrong list.  You should ask this on the Apache httpd user's list.

But just as a "generic" answer : Apache httpd itself has no idea that it is acting as a 
front-end for Tomcat.  Apache receives a request, processes the request URI in some 
standard ways, and stores the result in the request_rec object.
Then, at some later stage, Apache looks for a "handler" to generate the response to this 
request.  If it is configured properly, it will find one of the "proxy handlers" 
(mod_proxy or mod_jk, depending on which one you are using), and will then "pass" the 
request URI (and the request_rec object) to that handler. The handler then generates a 
response, which Apache receives and passes back to the client.
That the handler, in the background, connects to a Tomcat and asks Tomcat to generate the

response, is basically unknown to Apache.

If your module plays games with the URI, you probably have to be careful to update the 
"parsed URI" as well as the "unparsed URI" fields of the request_rec.
But again, you will get much better answers on the Apache httpd list, or you could 
probably also try the mod_perl list, where there are quite a few people knowledgeable 
about Apache httpd internals.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message