Spring MVC启动流程

千锋教育

1. 在web.xml文件中给Spring MVC的Servlet配置了load-on-startup,所以程序启动的时候会初始化Spring MVC;


2. 然后在HttpServletBean中将配置的contextConfigLocation属性设置到Servlet 中;


3. 接着在FrameworkServlet中创建了WebApplicationContext; 


4. DispatcherServlet根据contextConfigLocation配置的classpath下的xml文件初始化Spring MVC中的各组件。