在web.xml中配置了
org.springframework.web.context.ContextLoaderListener
springMVC
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath*:springMVC.xml,classpath*:businessApplication.xml,classpath*:CXFContext-client.xml
1
springMVC
/
contextConfigLocation
classpath:springMVC.xml
为什么加载了两遍springMVC.xml,这两个有什么不同吗?
springMVC
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath*:springMVC.xml,classpath*:businessApplication.xml,classpath*:CXFContext-client.xml
1
springMVC
/
contextConfigLocation
classpath:springMVC.xml
org.springframework.web.context.ContextLoaderListener
没用过spring的MVC,
先说这个类org.springframework.web.context.ContextLoaderListener是配置在servlet的listener,在servlet启动时会加载
contextConfigLocation
这里配置的所有spring的xml文件
我的理解是不是org.springframework.web.servlet.DispatcherServlet这个地址也配置了spring加载的xml文件。两个地方都会加载,引起的加载两遍呢?