Spring lets define multiple contexts in a parent-child hierarchy.
the applicationcontext.xml defines The beans for the "root webapp context", i.e. the context Asso Ciated with the WebApp.
the spring-servlet.xml (or whatever else call it) defines the beans for one servlet ' s app cont Ext. There can many of these in a webapp, one per Spring servlet (e.g. spring1-servlet.xml for Servle t spring1 , spring2-servlet.xml for servlet spring2 ).
Beans spring-servlet.xml in can reference Beans on applicationContext.xml , but not vice versa.
All Spring MVC controllers must go in the spring-servlet.xml context.
In the very simple cases, the applicationContext.xml context is unnecessary. It's generally used to contain beans, that's shared between all servlets in a webapp. If you are only having one servlet, then there's not really much point, unless has a specific use for it.
Question:
Why would multiple spring servlets?
It's sometimes useful to separate parts of your application, could otherwise conflict in the same context. As an example your may has ReST services and standard views, which you and different view resolvers or security concer NS for the services as-to-the views.
Difference between Applicationcontext.xml and SPRI