Announcement Announcement Module
No announcement yet.
Loading environment specific properties Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading environment specific properties


    i build my Spring app as a web application and deploy to one of 3 environments. Each time i build the war file (always on my local windows machine) I have to tweak certain properties so that Ant builds the right property files and places them inside the war.

    This technique works but is getting tedious as i build for different environments each day.

    An alternative is to have all the properties available to the application and then to load the correct property file. Without Spring, I would probably do something like this:

    1. String stName();
    2. look for a properties resource with that name in the classpath.

    Since I am using Spring, I was wondering if there was a more elegent solution to this already. Perhaps some intervention with the bean factory on start up to something to configure the app.

    Any ideas appreciated.



  • #2
    Take a look here.