Are you using Spring 3.1?
What I typically do here is use Spring Profiles. To make this work you just make sure to set spring.profiles.active variable in your environment somewhere (JNDI, System variable etc), when Spring picks it up it uses it initialize the correct profile.
For example (in
java config)
Now since these are PropertySources I can access them like this
Or alternatively I could use @Value etc as well