转自http://www.cnblogs.com/cczz_11/p/4363314.html
一、首先写一下代码结构。
SpringMVC
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
contextConfigLocation
/WEB-INF/classes/config/applicationContext.xml
org.springframework.web.context.ContextLoaderListener
springmvc
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/classes/config/Springmvc-servlet.xml
1
springmvc
/
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
/WEB-INF/classes/config/applicationContext.xml
contextConfigLocation
classpath:applicationContext.xml
contextConfigLocation
WEB-INF/applicationContext*.xml
contextConfigLocation
WEB-INF/applicationContext*.xml
contextConfigLocation
classpath*:conf/spring/applicationContext_core*.xml,
classpath*:conf/spring/applicationContext_dict*.xml,
classpath*:conf/spring/applicationContext_hibernate.xml,
......
contextConfigLocation
classpath*:**/applicationContext-*.xml