Yes, there is.  But it's not really a good idea.

What you ought to do instead is to specify these properties in your web.xml
file as a <context-param> element, like,

<webapp>
  <!-- ... -->
  <context-param>
    <param-name>TomcatHome</param-name>
    <param-value>c:/tomcat</param-value>
  </context-param>
</webapp>

And specifically, I I'm not sure you even need to know TOMCAT_HOME, when
you've got methods like ServletContext.getRealPath().

                                                            -- Bill K.


> -----Original Message-----
> From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 15, 2001 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: Accessing environment variables
> 
> 
> I have a question which is somewhat off topic...
> 
> Is there a way to access my environment varibables(ex. 
> TOMCAT_HOME) from my
> servlets running in tomcat?  I just need to somehow return the path to
> TOMCAT_HOME.  Is there some simple method call that can achieve this?
> 
> Thanks in advance!
> 
> Brandon
> 

Reply via email to