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 原理