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

  • Loading environment specific properties

    Hi,

    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 hostname=java.net.InetAddress.getLocalHost().getHo 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.

    Cheers

    Rakesh

  • #2
    Take a look here.

    Comment

    Working...
    X