Results 1 to 2 of 2

Thread: Loading environment specific properties

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    New York
    Posts
    168

    Default

    Take a look here.
    Karl Baum
    weblog: www.jroller.com/page/kbaum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •