Java – Storing properties in JNDI? Environment specific locations


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?


Best Solution

The regular way to pass parameter in Java EE 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.