日期:2014-05-20  浏览次数:20691 次

web.xml配置,请高人分析
1、
<context-param>
<param-name> contextConfigLocation </param-name>
<param-value> /WEB-INF/applicationContext*.xml </param-value>
</context-param>
        2、
<context-param>
<description>
Key   of   the   system   property   that   should   specify   the   root
directory   of   this   web   app.   Applied   by   WebAppRootListener   or
Log4jConfigListener.
</description>
<param-name> webAppRootKey </param-name>
<param-value> webapp.root </param-value>
</context-param>
        3、
<context-param>
<description>
Location   of   the   Log4J   config   file,   for   initialization   and
refresh   checks.   Applied   by   Log4jConfigListener.
</description>
<param-name> log4jConfigLocation </param-name>
<param-value> /WEB-INF/classes/log4j.xml </param-value>
</context-param>
        4、
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
        5、
<listener>
<description>
Leave   the   listener   commented-out   if   using   JBoss
</description>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
谁能帮我分析一下4、5这两个监听有什么用处,什么时间被触发。


------解决方案--------------------
SPRING框架的,去看看SPRING的书吧
------解决方案--------------------
监听应该是启动发布软件时触发~~~
------解决方案--------------------
这是规范给容器的一个监听注册,如果有则通知注册的那个类。

http://fanqiang.chinaunix.net/app/web/2006-04-29/4122.shtml
------解决方案--------------------
4.上下文加载时触发
5.Leave the listener commented-out if using JBoss
如果使用JBOSS时触发
具体做了社么要看ContextLoaderListener和Log4jConfigListener了