Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Externalizing properties

 
Bala Gangadhar
Ranch Hand
Posts: 103
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic