aspose file tools*
The moose likes Tomcat and the fly likes How to read tomcat-environment entries in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to read tomcat-environment entries in Java?" Watch "How to read tomcat-environment entries in Java?" New topic
Author

How to read tomcat-environment entries in Java?

starki fox
Greenhorn

Joined: Jul 20, 2005
Posts: 15
Hi,

could someone give my a hint how to read out a global
tomcat environment variable.
Do you have to use JNDI?

Thanks a lot
starki fox
Greenhorn

Joined: Jul 20, 2005
Posts: 15
could you tell me where the error is?

Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
Object o = envCtx.lookup("ehl");



<GlobalNamingResources>
<Environment name="ehl" type="java.lang.Boolean" value="false"/>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to read tomcat-environment entries in Java?
 
Similar Threads
where can I see Classpath of Tomcat 5?
My classpath doesn't stay upon reboot
Tomcat Servlet/Bean 500 Error
How to run Servlets
heap space setting for Tomcat on Linux