世界今头条!Spring原理之web.xml加载过程
2023-07-05 09:37:05 来源:博客园
(资料图片)
context-param配置创建contextConfigLocation /WEB-INF/applicationContext.xml
listener配置读取org.springframework.web.context.ContextLoaderListener
filter配置如果系统中有encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding utf-8 forceEncoding true encodingFilter springmvc
servlet配置springmvc org.springframework.web.servlet.DispatcherServlet 1 springmvc /
总结:ServletContext是WebApplicationContext的底层支撑,所有的外界配置信息读到ServletContext中,然后再通过ContextLoaderListener触发Spring根上下文的初始化
加载细节
关键词: