Jakarta Expression Language


The Jakarta Expression Language is a special purpose programming language mostly used in Jakarta EE web applications for embedding expressions into web pages.
The specification writers and expert groups of the Java EE web-tier technologies have worked on a unified expression language which was first included in the JSP 2.1 specification, and later specified by itself in JSR-341, part of Java EE 7.

History

The expression language started out as part of the JavaServer Pages Standard Tag Library and was originally called SPEL, then just Expression Language. It was a scripting language which allowed access to Java components through JSP. Since JSP 2.0, it has been used inside JSP tags to separate Java code from JSP, and to allow easier access to Java components.
Over the years, the expression language has evolved to include more advanced functionality and it was included in the JSP 2.0 specification. Scripting was made easier for web-content designers who have little or practically no knowledge of the core Java Language. This scripting language made JSP a scripting language in the true sense. Before EL, JSP consisted of some special tags like scriptlets, expressions etc. within which Java code was written explicitly. With EL the web-content designer needs only to know how to make proper calls to core Java methods.
EL was, both syntactically and semantically, similar to JavaScript expressions:
EL also liberated the programmer from having to know the particularities of how the values are actually accessed: object.property can mean either object.get or object.getProperty or object.getProperty etc.
During the development of JSP 2.0, the JavaServer Faces technology was released which also needed an expression language, but the expression language defined in the JSP 2.0 specification didn't satisfy all the needs for development with JSF technology. The most obvious limitations were that its expressions were evaluated immediately, and the JSF components could not invoke methods on server-side objects. A more powerful language was created with the following new features:
The new expression language worked well for the purposes of JSF. But developers had problems when integrating the JSP EL with the JSF EL because of conflicts. Because of these incompatibilities, the unified expression language initiative was started to unify these expression languages. As of JSP 2.1, the expression languages of JSP 2.0 and JSF 1.1 have been merged into a single unified expression language.
Version 3.0 of the expression language was developed in a JSR independent of the JSP and JSF specifications in . Some new features were added, most notably EL equivalents of Java 8 streams and lambda expressions.

Features

The unified EL is a union of the JSP and JSF expression languages. In addition to the features already available in the JSP EL, the unified EL has the following features:
This shows a simple example of Unified EL being used within a JSTL "c:out" tag:

An expression that calls a method with a parameter:
$

Implementations

  • is a library intended to facilitate the implementation of dynamic and scripting features in applications and frameworks written in Java. Latest release, Version: 3.1, 14 April 2017.
  • is an open-source implementation of the Unified Expression Language, specified as part of the JSP 2.1 standard. It is considered stable and feature complete and is licensed under the Apache License 2.0. JUEL is also suitable for use in non-JSP applications. Latest release, Version 2.2.7, 6 Feb 2014.
  • is the JSP 2.0 EL interpreter from Apache. Latest release, Version 1.0, 20 Jun 2003. Download links to source and binary are broken.