Mastering JavaServer Faces 2.2
上QQ阅读APP看书,第一时间看更新

EL immediate and deferred evaluation

EL evaluates expressions as immediate or deferred.

Immediate evaluation returns the result as soon as the page is first rendered. These kinds of expressions are read-only value expressions and they can be present only in tags that accept runtime expressions. They are easy to recognize after the ${} notation. Usually, they are used for arithmetic and logical operations in JSP pages.

Deferred evaluation can return the result at different phases of a page's life cycle depending on the technology that is using the expression. JSF can evaluate the expression at different phases of the life cycle (for example, during the rendering and postback phase), depending on how the expression is being used in the page. These kind of expressions can be value and method expressions, and they are marked by the #{} notation.

Note

In Facelets, ${} and #{} act the same.