Spring Active Profiles - setting via Properties Files
a great solution over on stackoverflow works essentially like this;
- create your own implementation of an ApplicationContextInitializer
- read in an external reference (could even be a database, but properties file makes more sense)
- get the ConfigurableEnvironment from the passed context
- set the spring active profiles
to use this inside something like a WAR file, use the web.xml and set the file as an init param for the context.