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>