Expression language
![]() | It has been suggested that this article be merged with Unified Expression Language. (Discuss) Proposed since October 2009. |
Expression Language (EL) is a scripting language which allows access to Java components (JavaBeans) 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 (than in Java code).
Evolution of EL occurred to make scripting easier for web-content designers who have little or practically no knowledge of the core Java Language. This scripting language makes 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 and can enjoy the true scripting flavour of a scripting language.
EL is, both syntactically and semantically, similar to JavaScript expressions:
- there is no typecasting
- type conversions are usually done implicitly
- double and single quotes are equivalent
object.property
has the same meaning asobject['property']
EL also liberates the programmer from having to know the particularities of how the values are actually accessed: object.property
can mean (depending on what the object
is) either object.get("property")
or object.getProperty("property")
or object.getProperty()
etc.
See also
- OGNL- An open source expression language used by WebWork (and Struts2).
- MVEL- Another open source EL used in many Java-based projects.
- Unified Expression Language- A successor to EL, also used by JavaServer Faces
External links