title: Where to store public properties for Java programs on WebLogic
body: <p>I am updating a legacy Java application that is deployed on JBoss 5 with JDK 1.6. The aim is to port it for WebLogic 12C with the latest JDK.</p>
  <p>One issue that I am facing is where/how to store server specific properties. Currently, the application uses an app.properties file to store them. The app is deployed in exploded form by simply copying all class, JSP, CSS, etc. files to JBoss' deploy folder and restarting the server. Before restarting, the values in app.properties (passwords, file paths, etc) are edited depending on the server on which deployment is being done, such as development, UAT or production. This is a very kludgy method and, yes, people often make the wrong change or forget to update a path resulting in mayhem.</p>
  <p>OTOH, if I get the dev team to give me a properly packaged WAR file and use the UI to deploy it, this would make life easier. In such a case, where to store the server specific items? For example, can JNDI be used to store strings? I could then set them once for each server and in the code use methods such as:</p>
  <pre><code>ctx = new javax.naming.InitialContext();
  String storagePath = (String) ctx.lookup(&quot;StoragePath&quot;);
  </code></pre>
  <p>I've already converted all the JDBC connections to JNDI.</p>
  <p>If JNDI cannot be used to store such data, kindly suggest an alternate method.</p>