Expression Language
Encyclopedia
Expression Language is a scripting language which allows access to Java
Java (Sun)
Java refers to several computer software products and specifications from Sun Microsystems, a subsidiary of Oracle Corporation, that together provide a system for developing application software and deploying it in a cross-platform environment...

 components (JavaBeans) through JSP
JavaServer Pages
JavaServer Pages is a Java technology that helps software developers serve dynamically generated web pages based on HTML, XML, or other document types...

. Since JSP 2.0, it has been used inside JSP
JavaServer Pages
JavaServer Pages is a Java technology that helps software developers serve dynamically generated web pages based on HTML, XML, or other document types...

 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 scriptlet
Scriptlet
In JavaServer Pages technology, a scriptlet is a piece of Java-code embedded in the HTML-like JSP code.The scriptlet is everything inside the tags. Between these the user can add any valid Scriplet i.e. any valid Java Code....

s, 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
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 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

  • OGNL
    OGNL
    Object-Graph Navigation Language , created by OGNL Technology, is an open-source Expression Language for Java, which, while using simpler expressions than the full range of those supported by the Java language, allows getting and setting properties , and execution of methods of Java classes...

    - An open source expression language used by WebWork
    WebWork
    WebWork was a Java-based web application framework developed by OpenSymphony that merged into the current Struts2 framework. It was developed with the specific intention of improving developer productivity and code simplicity...

     (and Struts2).
  • MVEL
    MVEL
    MVFLEX Expression Language is a hybrid dynamic/statically typed, embeddable Expression Language and runtime for the Java Platform. Originally started as a utility language for an application framework, the project is now developed completely independently.MVEL is typically used for exposing basic...

    - Another open source EL used in many Java-based projects.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK