What is an Expression Language (EL)?

3

Much used in JSF , the famous Expression Languages (EL's) symbolized by #{} . I do not know if other languages work with it. What do they mean?

    
asked by anonymous 24.02.2017 / 14:14

1 answer

3

Excerpt adapted directly from the Oracle documentation on Java EE 6 :

EL = Expression Language = Expression Language:

EL allows the developer to use simple expressions to dynamically access data from Java Beans (JavaBeans) components. For example, the "test" attribute of the following tag is populated with an EL expression that compares with the number of items in the session bean named Cart:

<c:if test="${sessionScope.cart.numberOfItems > 0}">
  ...
</c:if>

Remembering that EL is not Java or JSF exlusivity, you will find EL in several other technologies like PHP and AngularJS for example.

JavaServer Faces technology uses EL for the following functions:

  • Immediate or late expression evaluation;

  • Possibility to set and fetch data from Beans;

  • Possibility to invoke methods;

In short:

EL provides a way to use simple expressions to communicate the screen scripts (XHTML, JSP, or others) with the Java code that runs on the server. With this it is possible that we can easily transmit and manipulate data between the two layers without having to worry about all the impasse that occurs between both layers.     

24.02.2017 / 14:54