Spring Framework ContextLoaderListener

来源:互联网 发布:软件项目经理管理办法 编辑:程序博客网 时间:2024/06/05 07:35

reference: spring in action 3rd edition

ContextLoaderListener is a servlet listener that loads additional configuration into a Spring application context 

 alongside the application context created byDispatcherServlet


web.xml

!-- Default Spring configuration file: /WEB-INF/applicationContext.xmlTo specify Spring configuration files for ContextLoaderListener to load, set the contextConfigLocation parameter in the servlet context --><context-param><param-name>contextConfigLocation</param-name><!-- Unless specified otherwise, the paths are relative to the application root --><!-- classpath: to load xml as resources from the application classpath--><param-value>/WEB-INF/spitter-security.xmlclasspath:service-context.xmlclasspath:persistence-context.xmlclasspath:dataSource-context.xml</param-value></context-param><!-- Creates the Spring Container shared by all Servlets and Filters --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>


0 0
原创粉丝点击