1 WebApplicationContext的初始化
1.1 spring根容器
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
public class ContextLoaderListener extends ContextLoader implements ServletContextListener {
实现了ServletContextListener,是serlet容器的规范,容器会回调入contextInitialized方法。
public void contextInitialized(ServletContextEvent event) {
initWebApplicationContext(event.getServletContext());
}