【发布时间】: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 的后果是什么?
【问题讨论】: