Reading env-entries from application.xml

Hi,

I have an EAR file which consists of a JAR (for EJB components) and WAR files. I want to set some globals settings which can be reached by both EJB and Servlet layers.

The natural place seems to be application.xml and I've added the following lines into it:

<env-entry>

<env-entry-name>StaticContentDir</env-entry-name>

<env-entry-type>java.lang.String</env-entry-type>

<env-entry-value>/src/static</env-entry-value>

</env-entry>

But I can't read it and found no help in this forum and Google.

The following lines didn't work either.

dir = (String) new InitialContext().lookup("java:comp/env/StaticContentDir");

Is there any wise way to read this, or do I have to duplicate it on ejb-jar.xml and web.xml?

Regards

[849 byte] By [evilcata] at [2007-11-26 15:04:15]
# 1
Yes, you'll need to duplicate the env-entry within each module's deployment descriptor. Thereis currently no support for definining ear-level environment entries. --ken
ksaksa at 2007-7-8 8:53:54 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...