Description
I have a spring web app, which can be used in a number of configurations. Essentially, with different auth mechanism, or different backends. I need to be able to select which config profile to use, hopefully without repacking the WAR.
Solution
The solution I've come up with is to pass the contextConfigLocation in via JNDI, instead of defining it in web.xml.
Jetty:
<Set name="initParams"> <New class="java.util.HashMap"> <Put name="contextConfigLocation">WEB-INF/bean-nosecurity.xml</Put> </New> </Set>
Tomcat:
<Parameter name="contextConfigLocation" value="WEB-INF/beans-nosecurity.xml"
override="false"/>
