Storing properties in JNDI? Environment specific locations
I want access to a storage folder but its actual loca开发者_运维技巧tion 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.
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.
<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>
精彩评论