Jump to content

Expression language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Sleske (talk | contribs) at 13:53, 18 December 2012 (Correct mention of JSF). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 as object['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