*
The moose likes Other Application Frameworks and the fly likes Externalizing properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Externalizing properties" Watch "Externalizing properties" New topic
Author

Externalizing properties

Bala Gangadhar
Ranch Hand

Joined: Oct 07, 2008
Posts: 80
    
    1
Hi,

As part of my project i was asked to externalize all the property files from the war.
My plan is to place all the prop files somewhere and give that path as a value to some env variable like "APP_CONFIG_PATH"

And in java code using System.getenv() I read this path and load all the properties files.

So my question is
is this correct approach, is there any simple or better way of doing it in Jboss in built features.
as my Dev environment is Windows and QA and Production environments are Linux : Are there any issues with this approach.


Regards,
Bala.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's cleaner to put the properties on the classpath, or supply the config file location as an init parameter, rather than relying on an environment variable. Sometimes an environment variable is more convenient, but consider using an init param *unless* the environment variable is present.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Externalizing properties
 
Similar Threads
Using PropertyResourceBundle on Tomcat
File access standards
Client and server setup - database location
Using hibernate.cfg.xml
Unable to load properties file in Java using eclipse