It's not a secret anymore!
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
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Externalizing properties" Watch "Externalizing properties" New topic

Externalizing properties

Bala Gangadhar
Ranch Hand

Joined: Oct 07, 2008
Posts: 98

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.

David Newton

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:
subject: Externalizing properties
jQuery in Action, 3rd edition