首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JSF 2和Spring 3集成

JSF 2和Spring 3集成
EN

Stack Overflow用户
提问于 2011-02-26 02:12:02
回答 1查看 6.1K关注 0票数 1

在我们的JSF2,Spring3web应用程序中,我们在web.xml中有以下几组条目来集成spring和JSF

代码语言:javascript
复制
<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教程之后,我发现除了定义RequestContextListener之外,还需要定义一个ContextLoaderListener.

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

两位听众都是强制性的吗?不定义RequestContextListener的后果是什么?

EN

回答 1

Stack Overflow用户

发布于 2011-02-28 11:49:50

两者都不是强制性的,只有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。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5124622

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档