Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Externalizing properties  RSS feed

 
Ranch Hand
Posts: 125
2
  • 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.
 
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.
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!