background image

Immediate and Deferred Evaluation Syntax

<< JavaServer Faces Technology, | Immediate Evaluation >>
<< JavaServer Faces Technology, | Immediate Evaluation >>

Immediate and Deferred Evaluation Syntax

The unified EL also allows custom tag developers to specify which of the following kinds of
expressions that a custom tag attribute will accept:
Immediate evaluation expressions or deferred evaluation expressions. An immediate
evaluation expression is evaluated immediately by the JSP engine. A deferred evaluation
expression can be evaluated later by the underlying technology using the expression
language.
Value expression or method expression. A value expression references data, whereas a
method expression invokes a method.
Rvalue expression or Lvalue expression. An rvalue expression can only read a value, whereas
an lvalue expression can both read and write that value to an external object.
Finally, the unified EL also provides a pluggable API for resolving expressions so that
application developers can implement their own resolvers that can handle expressions not
already supported by the unified EL.
This section gives an overview of the unified expression language features by explaining the
following topics:
"Immediate and Deferred Evaluation Syntax" on page 148
"Value and Method Expressions" on page 150
"Defining a Tag Attribute Type" on page 156
"Deactivating Expression Evaluation" on page 157
"Literal Expressions" on page 158
"Resolving Expressions" on page 160
"Implicit Objects" on page 162
"Operators" on page 163
"Reserved Words" on page 163
"Examples of EL Expressions" on page 164
"Functions" on page 165
Immediate and Deferred Evaluation Syntax
The unified EL supports both immediate and deferred evaluation of expressions. Immediate
evaluation means that the JSP engine evaluates the expression and returns the result
immediately when the page is first rendered. Deferred evaluation means that the technology
using the expression language can employ its own machinery to evaluate the expression
sometime later during the page's life cycle, whenever it is appropriate to do so.
Those expressions that are evaluated immediately use the ${} syntax, which was introduced
with the JSP 2.0 expression language. Expressions whose evaluation is deferred use the #{}
syntax, which was introduced by JavaServer Faces technology.
Because of its multiphase life cycle, JavaServer Faces technology uses deferred evaluation
expressions. During the life cycle, component events are handled, data is validated, and other
Unified Expression Language
The Java EE 5 Tutorial · September 2007
148