大家看下以下代码,请问配置监听器类“org.springframework.web.context.request.RequestContextListener”有什么用处呢。
 <!-- 载入Spring ApplicationContext -->
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 
 <!--  支持session scope的Spring bean  -->
 <listener>
  <listener-class>
   org.springframework.web.context.request.RequestContextListener
  </listener-class>
 </listener>

解决方案 »

  1.   

    让WEB优先加载,不然WEB之后的其他应用不能用
      

  2.   

    ContextLoaderListener预设会读取applicationContext.xml(spring默认配置文件)
    如果你有其他的配置文件就要在<context-param>中指定
      

  3.   

    我的意思是RequestContextListener这个类有什么用处喔,呵呵,谢谢大家的支持
      

  4.   

    看这个链接吧。很清楚了。http://hi.baidu.com/jlhh/blog/item/b726c62a150d489b033bf621.html
      

  5.   

    request表示该针对每一次HTTP请求都会产生一个新的bean,同时该bean仅在当前 HTTP
    request内有效,配置实例: request、session、global
    session使用的时候首先要在初始化web的web.xml中做如下配置: 如果你使用的是Servlet
    2.4及以上的web容器,那么你仅需要在web应用的XML声明文件 web.xml中增加下述ContextListener即可:
    <web-app>
    org.springframework.web.context.request.RequestContextListener ...
    <listener> <listener-class>
    org.springframework.web.context.request.RequestContextListener
    </listener-class> </listener> ... </web-app>
      

  6.   

    当理需要使用手动管理action或者servlet的生命周期的时候,就需要配置RequestContextListener,
    <bean id="class" scope="request"/> 
    <bean id="class" scope="session"/> 
    request的时候,提交完成之后,就销毁
    session的时候,关闭浏览器销毁对这东西我没实际用过,值知道有这么个概念,楼主多试验
      

  7.   

    使Spring支持request与session的scope,如:<bean id="loginAction" class="com.foo.LoginAction" scope="request"/>