applicationContext.xml是随ContextLoaderListener的加载而执行的,
而xxx-servlet.xml是随DispatcherServlet的加载而执行的,
在web.xml中,加载顺序是listener>filter>servlet
所以applicationContext.xml先加载!
而xxx-servlet.xml是随DispatcherServlet的加载而执行的,
在web.xml中,加载顺序是listener>filter>servlet
所以applicationContext.xml先加载!

本文解析了Spring框架中配置文件applicationContext.xml与xxx-servlet.xml的加载顺序。指出applicationContext.xml随ContextLoaderListener加载而先于随DispatcherServlet加载的xxx-servlet.xml执行。
1063

被折叠的 条评论
为什么被折叠?



