欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

web.xml配置spring容器监听器和log4j监听器

程序员文章站 2022-05-01 11:34:51
...
<!-- 加载spring容器 -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:spring/applicationContext*.xml</param-value>
	</context-param>

	<!-- 加载log4j -->
	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>classpath:resources/log4j.properties</param-value>
	</context-param>
	<!--Log4jConfigListener是不需要配的,因为有ContextLoaderListener -->
<!--	<listener>-->
<!--		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>-->
<!--	</listener>-->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
相关标签: 监听器配置