In a Java-based web application, all servlets are defined in the web.xml file. It is loaded in a web container at the bootstrap, and maps each servlet to a particular URL pattern. Similarly, the org.springframework.web.servlet.DispatcherServlet is the centerpiece of the Spring MVC; it needs to be configured in the same file--web.xml, and it is loaded at the bootstrap of the web application. At the time of bootstrapping, DispatcherServlet is invoked to create Spring's org.springframework.web.context.WebApplicationContext by loading the beans' configuration through Java, XML, or annotation-based. The servlet tries to fetch all the required components from this web application context. It has the responsibility to route the request through all the other components.
ApplicationContext webApplicationContext = RequestContextUtils.findWebApplicationContext(request);