my dog learned polymorphism*
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"/>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to read tomcat-environment entries in Java?