tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Accessing Env variables from tomcat servlets
Date Fri, 11 Aug 2000 16:59:47 GMT
Gopa Kumar wrote:

> This does not solve my problem, which is getting some module (Apache)
> specific information to the servlets.  I have been using env vars for
> getting this info to Perl cgi scripts. If custom env vars do not work with
> tomcat, is there is an alternate way to get some module specific info to the
> servlets ?
>

The reason that environment variables are not usually appropriate in Java is
that they are global to an entire process.  That's fine in the CGI world (or in
mod_perl where the environment simulates this), but in a servlet container such
variables would be global to all requests -- which is normally not what you
want.

One way might be to have your module pass what looks (to the communications
module that talks to Tomcat) like an HTTP header coming in with the request.
This would be passed along with all the other HTTP headers, and could then be
retrieved on the receiver side.  I don't know enough about Apache's module
interface to know if this is feasible or not.

Failing that, you'd probably have to modify the communications protocol being
used between Apache and Tomcat.


>
> -Gopa
>

Craig



Mime
View raw message