If you mean passing a value to a servlet, it can be set in the particular
context's dir.

for an example look in
$TOMCAT_HOME/webapps/examples/WEB-INF/web.xml - this will show parametres
being passed to a servlet.

If you are interested in a global variable, I found that only the classpath
gets passed into java itself, so you can add a file like xyz.jar to your
classpath, then load your classpath in java, search the string for xyz.jar,
and then get the directory from in front of 'xyz.jar'.

I use the second method quite alot, expecially when the program is started
from scripts, like tomcat is.

Hopefully this helps,
Rob

On Thursday 22 March 2001 22:24, you wrote:
> Hi,
> My name is Vidya. I need help!!
> I am using Tomcat with Apache.
> I am trying to set an environment variable and pass it to my JVM. Earlier i
> was using Apache Jserv as the servlet engine (no Tomcat was involved then).
> There, i simply had to set
> wrapper.bin.parameters=-D<env_name>=<env_value> , inside the
> jserv.properties file.
>
> In case of tomcat, how can u set it? I set the env. variable by manually
> setting it by going to
> "Mycomputer........"  . But when i try to access it thru a servlet or
> a simple class , it is not available. I'm getting very frustrated with it.
> I tried setting it in tomcat.bat also...but to no avail...
>
> Please help me. I am hoping to hear from u....
> Thanx ,
> Vidya
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to