What is the correct way to split Spring\'s configuration to multiple xml files?
At the moment I have
/WEB-INF/foo-servlet.xml
There are two types of contexts we are dealing with:
1: root context (parent context. Typically include all jdbc(ORM, Hibernate) initialisation and other spring security related configuration)
2: individual servlet context (child context.Typically Dispatcher Servlet Context and initialise all beans related to spring-mvc (controllers , URL Mapping etc)).
Here is an example of web.xml which includes multiple application context file
Spring Web Application example
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
/WEB-INF/spring/jdbc/spring-jdbc.xml
/WEB-INF/spring/security/spring-security-context.xml
spring-mvc
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring/mvc/spring-mvc-servlet.xml
spring-mvc
/admin/*