Suppose that I have a Spring Java project and I am trying to configure it as a web server servlet. Here is a stripped-down version of the web.xml f
The below part loads the context file and create the ApplicationContext. This context might, for instance, contain components such as middle-tier transactional services, data access objects, or other objects that you might want to use (and re-use) across the application. There will be one application context per application.
contextConfigLocation
/WEB-INF/spring/generalApplicationContext.xml
The other context is the WebApplicationContext which is the child context of the application context. Each DispatcherServlet defined in a Spring web application will have an associated WebApplicationContext. The initialization of the WebApplicationContext happens like this:
my-servlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring/specificApplicationContext.xml
1
For more details refer this and this