1

JSF 2.1.7(和一般的 2.1.x)需要 Servlet 3.0 还是只需要 2.5?如果您查看 pom http://repo1.maven.org/maven2/com/sun/faces/jsf-api/2.1.7/jsf-api-2.1.7.pom,您会发现 servlet 3,但似乎引用 JSF 2.2(另请参见标签名称:“Oracle 对 JSF 2.2 规范 API 的实现。”)

我在网上找到了这个问题的不同答案。谁能帮我?一些链接:

加载具有复合组件Mojarra Java EE 5/6 兼容性 的页面时出现 Mojarra JSF 2.1.9 异常https://forums.oracle.com/forums/thread.jspa?messageID=10140121

谢谢

4

2 回答 2

3

The Servlet 3.0 requirement in Mojarra 2.1 is merely for the "optional stuff", such as auto-registration of the FacesServlet on URL patterns *.jsf, *.faces and /faces/* without the need to write it down in webapp's own web.xml.

Mojarra 2.1 is however backwards compatible with Servlet 2.5, you'll only miss the "optional" stuff and among others need to register the FacesServlet in web.xml yourself (although I would personally recommend to do it anyway on an URL pattern of *.xhtml).

于 2013-01-14T12:00:59.827 回答
1

Take a look at specification. Preface (Related technologies) says that one of requirements is Servlet API version 2.5, so you don't need version 3.0. Also this page quotes Ed Burns who states that is dependent only on 2.5

于 2013-01-14T11:59:08.090 回答