【问题标题】:JSF 2 and Spring 3 integrationJSF 2 和 Spring 3 集成
【发布时间】:2011-02-26 02:12:02
【问题描述】:

在我们的 JSF 2、spring 3 Web 应用程序中,我们在 web.xml 中有以下条目集以集成 spring 和 JSF

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/spring/applicationContext.xml</param-value>
</context-param>

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

它有效!

但是,在阅读了一些 JSF 和 spring 教程之后,我发现除了 ContextLoaderListener 之外还需要定义一个 RequestContextListener

我们的应用程序中有请求范围和会话范围 bean。

两个监听器都是强制性的吗?不定义 RequestContextListener 的后果是什么?

【问题讨论】:

    标签: spring jsf


    【解决方案1】:

    两者都不是强制性的,只有 ContextLoaderListener

    http://static.springsource.org/spring/docs/3.0.x/reference/web-integration.htmlhttp://forum.springsource.org/showthread.php?t=81382

    RequestContextListener 似乎对于 Facelets 是强制性的

    http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/web/context/request/RequestContextListener.html

    此侦听器主要用于第三方 servlet,例如JSF FacesServlet。

    【讨论】:

      猜你喜欢
      • 2011-11-20
      • 1970-01-01
      • 2015-06-29
      • 2012-07-02
      • 2013-09-02
      • 1970-01-01
      • 2012-06-28
      • 2018-11-11
      • 1970-01-01
      相关资源
      最近更新 更多