tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gopa Kumar <gopa.ku...@ardentsoftware.com>
Subject RE: Accessing Env variables from tomcat servlets
Date Fri, 11 Aug 2000 16:45:49 GMT
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 ?

-Gopa


-----Original Message-----
From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
Sent: Friday, August 11, 2000 10:26 AM
To: tomcat-user@jakarta.apache.org
Subject: Re: Accessing Env variables from tomcat servlets


Gopa Kumar wrote:

> Hi,
>
> Does anybody know how to access env variables from tomcat servlets.  I
have
> an Apache module that adds a bunch of env vars into
> request_rec->subprocess_env.  They are working ok with Perl CGI.  Since I
am
> now trying to port some of these scripts into servlets, I need to access
> these vars from servlets.  I tried setting tomcat.properties
> wrapper.env.copyall=true and also ApJServEnvVar but to no avail.
> req.getAttributeNames still does not return any of my env vars.
> Incidentally, I did see code for handling ApJServEnvVar in mod_jserv.c.
Am
> I doing something wrong, or is there another way to access these variables
?
>

Most of the environment variables you are interested in are actually
request
properties on the request object.  For instance, the value of the
PATH_INFO
environment variable corresponds to the request.getPathInfo() method. 
Check out
the API documents on the javax.servlet.http.HttpServletRequest interface
(and
javax.servlet.ServletRequest, which it extends) to see what information
is
available to you.


>
> thanks,
>
> -Gopa

Craig McClanahan

Mime
View raw message