zoukankan      html  css  js  c++  java
  • Spring监听器配置

    使用spring框架时如果同时使用org.springframework.web.util.Log4jConfigListener监听器,那么在web.xml中的监听器的注册顺序为org.springframework.web.context.ContextLoaderListener在后,org.springframework.web.util.Log4jConfigListener在前,否则就回出现如下警告:

    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.

    我们在spring的api文档中可以看到下面一段说明:

    Bootstrap listener to start up Spring's root WebApplicationContext. Simply delegates to ContextLoader.

    This listener should be registered after Log4jConfigListener in web.xml, if the latter is used.

    正确配置如下:

    <listener>  
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>  
    </listener>  
    <listener>  
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
    </listener>  
    

      

  • 相关阅读:
    Java-WebDriver模块
    Java-数据类型(八中基本数据类型)
    Java基础
    Java介绍
    Eclipse介绍
    Jmeter-服务器监控技术
    性能测试
    Jmeter-相关字段含义
    Jmeter-监听器
    Jmeter-BeanShell组件应用
  • 原文地址:https://www.cnblogs.com/JAYIT/p/4100846.html
Copyright © 2011-2022 走看看