As stated in the comment:
Spring Security versions prior to 3.1.x do not allow multiple http element definitions.
3.1, however.
Here is the Jira problem for this feature.
This article about changes 3.1 may also be useful.
You can specify a different context file in the web.xml file:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring-contexts/context1.xml /WEB-INF/spring-contexts/context2.xml </param-value> </context-param>
Or you can specify the directory in which your contexts will be indicated, and name them in any way, without specifying each context file separately:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring-contexts/* </param-value> </context-param>
Regarding Ayusman's answer, you can import security contexts into bean contexts:
<beans> <import resource="classpath*:/security-context-*.xml"/> <bean></bean> </beans>
source share