You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Laurelin of Middle Earth, 630-840-2214" <la...@fnal.gov> on 2000/10/04 22:59:48 UTC

Can I access environmental variables in servlets under tomcat?

I'm running tomcat v3_1 under apache on a UNIX web server.

I have CGI scripts that are able to access various environmental
variables which have been set and "PassEnv" to the webserver 
environment.

How do I accomplish this within tomcat?  It seems that the
environmental variables always come back as "null", using
constructs such as
   String tomcat_home = System.getProperty("TOMCAT_HOME");

When I do the moral equivalent from a perl script, it works
just fine.

Any help appreciated.

-- lauri
lauri@fnal.gov