Sunday, 1 September 2013

Include different config file in contextConfigLocation based on a property in properties file

Include different config file in contextConfigLocation based on a property
in properties file

I have a contextConfigLocation in web.xml which is being used to load bean
definitions:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/spring-properties.xml
/WEB-INF/config/spring-framework.xml
/WEB-INF/config/spring-persistance.xml
/WEB-INF/config/spring-services.xml
/WEB-INF/config/spring-actions.xml
/WEB-INF/config/spring-security.xml
/WEB-INF/config/spring-groovy.xml
</param-value>
</context-param>
However based on a property which is set in my properties file I want to
be able to include another service file instead of the spring-services.xml
file as above.How could I do that.

No comments:

Post a Comment