且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JSP EL,JSF EL和Unified EL之间的区别

更新时间:2023-12-04 17:35:52


  • Jun 2002:JSTL 1.0首次与EL一起推出。那些 $ {} 只适用于JSTL标签的东西。它旨在调用Javabean get 方法。

    • Jun 2002: JSTL 1.0 was introduced with EL for first time. It were those ${} things which works in JSTL tags only. It is designed to call Javabean get methods.

      2003年11月:引入了JSP 2.0,EL是在 javax.servlet.jsp.el 包,它作为J2EE 1.4标准的一部分成为标准EL 。 JSTL 1.1没有EL发货。现在 $ {} 也可以在JSP模板文本的JSTL标签之外工作。

      Nov 2003: JSP 2.0 was introduced and EL was moved from JSTL 1.0 to JSP 2.0 in javax.servlet.jsp.el package and it became standard EL as part of J2EE 1.4 standard. JSTL 1.1 was shipped without EL. Now ${} works outside JSTL tags in JSP template text as well.

      2004年3月:JSF在延迟EL 1.0 noreferrer> javax.faces.el 包。那些#{} 只能在JSF标签内部工作的东西。与标准JSP EL $ {} 的区别在于它不仅可以执行 get ,还可以执行设置。这对于托管bean自动创建和设置输入组件的值是必需的。标准EL $ {} 也适用于JSF输出标记,但如果它们在范围内不存在则不会自动创建bean而它们不会设置输入值。

      Mar 2004: JSF 1.0 was introduced with deferred EL in javax.faces.el package. It were those #{} things which works inside JSF tags only. The difference with standard JSP EL ${} is that it doesn't only do get, but can also do set. This was mandatory for managed bean auto-creation and setting the values of input components. The standard EL ${} works in JSF output tags as well, but they won't auto-create beans if they don't exist in scope yet and they won't set input values.

      2005年5月:在准备应于2006年5月发布的新JSP 2.1时,延迟EL #{} 是从JSF中提取的,并与 $ {} 结合使用/5/api/javax/el/package-summary.htmlrel =noreferrer> javax.el 包。那时,它变成了统一EL ,它随JSF 1.2引入,后来成为JSP 2.1和Java EE 5标准的一部分。 #{} 现在也可以在JSP标记中用于获取值,但不能用于设置值。现在,JSP中的 $ {} 也可以自动创建托管bean,但不能设置值。

      May 2005: While still preparing for new JSP 2.1 which should be released May 2006, deferred EL #{} was extracted from JSF and combined with standard EL ${} in the javax.el package. At that point, it became unified EL which was introduced with JSF 1.2 and became later part of JSP 2.1 and Java EE 5 standard. The #{} can now also be used in JSP tags to get values, but not to set values. The ${} can now in JSP also auto-create managed beans, but not set values.

      2006年11月:Facelets被引入作为JSP的继承者。它允许在JSF标记之外的模板文本中使用#{} ,以替代< h:outputText> 没有任何属性。它还将 $ {} 视为#{} ,因此它们在Facelets中的行为相同。

      Nov 2006: Facelets was introduced as successor of JSP. It allowed for use of #{} in template text outside JSF tags, as substitute for <h:outputText> without any attributes. It also treats ${} as #{}, so they both behave the same in Facelets.

      2009年12月:EL从JSP规范中提取出来并成为一个独立的规范,它将独立于JSP维护,第一个版本是EL 2.2(JSR-245),类似于JSP 2.2。主要的新功能是调用参数化方法,而不是仅在#{} 语法中调用Javabean getters / setter,例如#{bean.method(自变量)} 。此外,Facelets成为Java EE 6标准的一部分。

      Dec 2009: EL was extracted from JSP specification and became a standalone specification which will be maintained independently from JSP, the first version being EL 2.2 (JSR-245), analogous with JSP 2.2. Main new feature is calling parameterized methods instead of only calling Javabean getters/setters inside #{} syntax, e.g. #{bean.method(argument)}. Furthermore, Facelets became part of Java EE 6 standard.

      2013年6月:引入了EL 3.0,它带有一个独立的EL处理器,允许在普通的Java中使用SE应用程序。其他主要新功能是新的字符串连接运算符 + = ,集合对象的新操作,包括流和Lambda表达式 - > (即使在Java 6/7上!)并将常量导入EL范围。

      Jun 2013: EL 3.0 was introduced which comes with a standalone EL processor, allowing usage in a plain Java SE application. Other main new features are the new string concatenation operator +=, new operations for collection objects, including streams and Lambda expressions -> (even on Java 6/7!) and importing constants into EL scope.