In a servlet I do the following:
Context context = new InitialContext();
value = (String) context.lookup("java:comp/env/propertyName");
On an Apache Geronimo instance (WAS CE 2.1) how do i associate a value with the key propertyName?
In Websphere AS 6 i can configure these properties for JNDI lookup under the "Name Space Bindings" page in the management console, but for the life of me I can find no way to do this in community edition on the web.
One possibility is to add the properties to your web.xml file (in the WEB-INF directory), using one or more
<env-entry>tags. For example, something like the following:Each env-entry tag declares a new environment variable that you can then access from the
java:comp/envcontext.Once you add the necessary
env-entry's you can use code similar to what you already posted to access these values. Mind you, I don't have Geronimo installed, so I don't know if there is any additional configuration that needs to be done in order to make this work.