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.
It is possible to put your properties in a file and make the name and location of the file a resource-ref of type URL in web.xml. The value of the resource is set in geronimo-web.xml.
Your web.xml will have the following entry:
In geronimo-web.xml you define the value for the configFileName
In java you have the following code to lookup the value:
Then you have to open the file and read whatever value is in there.
The result of all this is that you have the properties in a file on the filesystem. It will not be overwritten if you redeploy your application.