You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Han Ming Ong <ha...@chirpyfish.org> on 2001/10/17 20:20:41 UTC

How to pass values from Tomcat server to application?

  Hi folks,

Currently we have an application that can be deployed on Unix and 
Windows platform. This application depends on a INSTALL_PATH environment 
variable that our launch script converts into a Java property variable 
before feeding to the application with the -D flag.

We are converting this application to have a servlet front end. Our 
initial design is to put this INSTALL_PATH into the <context-param> into 
the deployment descriptor (web.xml) of the application. This works well 
in general during development since we usually have the exploded war 
directory to play with. But on each deployment machine, we don't want to 
explode the .war file and manually change the value.

In Tomcat, there is a top level web.xml file that we can use to set the 
value as a <context-param>. However, the value in the application 
web.xml file will overwrite that in the top level web.xml file.

Our immediate solution is to use a different variable name 
TOP_INSTALL_PATH for the Tomcat level web.xml file.

But is there another way to pass in values from the Tomcat server to our 
application? Is there a generic way that works for Weblogic as well?

Thanks much, ohmson