Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting environment variable at startup

Status
Not open for further replies.

bthale

Programmer
Oct 31, 2001
108
US
According to the documentation for context.xml configuration in Tomcat6, I should be able to use
<Environment/> element in the context.xml file under the /conf folder to set an environment variable. I do not want to use web.xml and set per app. I need to set for the whole server.
I tried this:
<Environment name="env" value="DEV" type="java.lang.String"/>

But my variable isn't recognized.

I also tried changing web.xml on the application level using the <env-entry> element. This did not work either.
Am I supposed to use <context-param>? I'm following what is in the Tomcat docs.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top