tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alyssa Kwan <>
Subject Setting Environment Variable for Tomcat 6 Servlet
Date Fri, 21 Jan 2011 21:29:49 GMT
Hi All,

I'm using Ubuntu's default installation of Tomcat 6. I'm deploying a ROOT.war, and trying
to set an environment variable specific to it, i.e. accessible from System.getenv() in the

According to the docs (, I can
specify this in a Context element in conf/Catalina/localhost/ROOT.xml. I've created that with
these contents:

 <Environment name="FOO" value="bar" type="java.lang.String" override="false"/>

And I've deployed the webapp as usual, i.e. to webapps/ROOT.war.

Server.getenv("FOO") in the Servlet.init(config) still returns null. What am I missing?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message