Spring MVC启动流程
发布时间:2022-10-27 16:48:16
发布人:wjy

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中的各组件。