RE: passing environment variables to Tomcat

2002-07-29 Thread Shapira, Yoav

Hi,
Have you considered putting this variable in the web.xml?  You (should)
always have control over your web.xml file, whereas your service
provider may not let you mess around with their server.xml file.  You
can put it in a context-param or an init-param to a startup servlet...

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Chen, Dean (Zhun) [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:29 AM
To: 'Tomcat Users List'
Subject: passing environment variables to Tomcat

Hi,
I'm using Tomcat 4.0.3, we need to pass an environment variable to
Tomcat.
In essence, we are trying to define the environment variable, i.e.:
DEV,
QA,
PROD, etc.

Currently, we do this by modifying the catalina.sh and add this to the
runtime command
-Dweb.env=$WEB_ENV \

However, can this be done by modifying the server.xml instead? I don't
believe we will have write access to catalina.sh in the future.

Thanks,

Dean

--
To unsubscribe, e-mail:   mailto:tomcat-user-
[EMAIL PROTECTED]
For additional commands, e-mail: mailto:tomcat-user-
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: passing environment variables to Tomcat

2002-07-29 Thread Greg Waehner

Yes. There are three ways.

1. JAVA_OPTS  you can set your JAVA_OPTS env. variable. The startup
includes this. This works, but is a little wierd since you're not really
passing Java optional startup parameteres.

2. You ~could~ use the web.xml file within your webapp, but then you have
to worry about conflicts b/w dev, staging, and live.

2. As you thought, doing it via server.xml is a better way, if you have
control over it.
You can set a context parameter.

Context
   Parameter name=foo value=bar/
/Context

-Original Message-
From: Chen, Dean (Zhun) [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:29 AM
To: 'Tomcat Users List'
Subject: passing environment variables to Tomcat


Hi,
I'm using Tomcat 4.0.3, we need to pass an environment variable to Tomcat.
In essence, we are trying to define the environment variable, i.e.: DEV, QA,
PROD, etc.

Currently, we do this by modifying the catalina.sh and add this to the
runtime command
-Dweb.env=$WEB_ENV \

However, can this be done by modifying the server.xml instead? I don't
believe we will have write access to catalina.sh in the future.

Thanks,

Dean

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]