Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read tomcat-environment entries in Java?

 
starki fox
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic