views:

132

answers:

1

I want access to a storage folder but its actual location can vary with environments. Could I store properties into JNDI or do something similar to a datasource in JBOSS? How would I go about it?

Thanks.

+1  A: 

The regular way to pass parameter in JEE application is through the property in the deployment descriptor using env-entry. They will be bound in the JNDI so that you can inject them.

<env-entry>
<env-entry-name>docroot_path</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/usr/local/foo</env-entry-value>
</env-entry>
ewernli
Thanks a lot. After reading your post before you put in example code I found some <env-entry> examples.
jgrowl