You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Powe <mi...@trollope.org> on 2010/07/12 15:26:07 UTC

Request Processing by Apache httpd for Tomcat

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.

Thanks for any help.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA


 Which is worse: ignorance or apathy?  Who knows?  Who cares?

Re: Request Processing by Apache httpd for Tomcat

Posted by André Warnier <aw...@ice-sa.com>.
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org