springmvc-servlet.xml,applicationContext.xml 哪个先被加载
1、applicationContext.xml是随ContextLoaderListener的加载而执行的,而xxx-servlet.xml是随DispatcherServlet的加载而执行的,在web.xml中;
2、加载顺序是listener>filter>servlet;
3、applicationContext.xml先加载!
先看web.xml配置
默认去找一个applicationContext.xml 的文件
为什么?
然后默认去找一个*-servlet.xml的文件
为什么?
Spring MVC 原理