【问题标题】:How can I check what version of EL is server using如何检查服务器使用的 EL 版本
【发布时间】:2011-11-06 09:51:48
【问题描述】:

如何查看服务器使用的 EL 版本。 我正在运行 Websphere 7 。 EL 类在 j2ee.jar 中,清单如下。

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 2.4 (IBM Corporation)
Specification-Title: Java Platform, Enterprise Edition Specification
Specification-Version: 5.0
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: Java Platform, Enterprise Edition Specification
Implementation-Version: 5.0
Implementation-Vendor: Sun Microsystems, Inc.
Class-Path: activation-impl.jar mail-impl.jar

【问题讨论】:

    标签: jsf jakarta-ee el


    【解决方案1】:

    EL 版本与 Servlet/JSP 版本密切相关,后者取决于所使用的 servletcontainer 实现/版本以及您的 web 应用程序的 web.xml 根声明。

    • Servlet 5.0 附带 JSP 3.0 和 EL 4.0 (Jakarta EE 9)。
    • Servlet 4.0 附带 JSP 2.3 和 EL 3.0 (Java EE 8)。
    • Servlet 3.1 附带 JSP 2.3 和 EL 3.0 (Java EE 7)。
    • Servlet 3.0 附带 JSP 2.2 和 EL 2.2 (Java EE 6)。
    • Servlet 2.5 附带 JSP 2.1 和 EL 2.1 (Java EE 5)。
    • Servlet 2.4 附带 JSP 2.0 和 EL 2.0 (J2EE 1.4)。
    • Servlet 2.3 附带没有 EL 的 JSP 1.2 (J2EE 1.3)。 EL 将由 JSTL 1.0 提供,并且只能在 JSTL 标记内工作。

    WebSphere 7 是经过 Java EE 5 认证的容器,因此意味着 Servlet 2.5,而后者又随 JSP/EL 2.1 一起提供。但是,如果您的 webapp 的 web.xml 被声明为符合例如 Servlet 2.4,那么您的 webapp 将以带有 JSP/EL 2.0 的 Servlet 2.4 模式运行。

    既然你标记了这个 JSF,我想这个问题的唯一目的是弄清楚你是否可以使用新的 EL 2.2 特性,即能够在 EL 中调用带有参数的非 getter 方法。因此,您的容器本身并不支持它。但是,您可以按照 this answer 安装 JBoss EL 以使其在 Servlet 2.5 容器上工作。

    另见:

    【讨论】:

    • 您到底在问什么 JSF 规范项?我的回答中没有提及任何内容。请注意,JSF 和 Servlet/JSP/EL 并没有紧密耦合。如果您想了解某个 JSF 版本所需的最低 Servlet/JSP API,请查看this answer
    猜你喜欢
    • 2018-12-22
    • 1970-01-01
    • 2016-12-15
    • 2022-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-09
    相关资源
    最近更新 更多