web.xml组件结构
1、listener:
(springIOC_Context-父容器创建,再将其set进 servletContext)
ContextLoaderListener
->ServletContextListener.contextInitialized(ServletContextEvent event)
->ContextLoader.initWebApplicationContext(servletContext)
->createWebApplicationContext
->configureAndRefreshWebApplicationContext(cwac, servletContext)
->wac.refresh()(Spring容器加载bean的入口)
2、servlet:
(springMVC_Context-子容器创建,再将springIOC_Context设置为的parent)DispatcherServlet
3、filter:
对请求或响应(Request、Response)统一设置编码、用户是否已经登陆、有没有权限访问该页面等等