First page Back Continue Last page Text

oracle adf workshop

Notes:


Referencing Managed Beans

You can reference managed beans by using either Expression Language (EL) or Java, as shown in the examples in the slide. Expression language is described in the lesson titled “Implementing Transactional Capabilities.”

What the Java code in the slide does is to assign the value of a managed bean (whose name is expressed in EL) to a User object. It uses the following classes and methods:

FacesContext is a class that contains all of the per-request state information related to the processing of a single JSF request, and the rendering of the corresponding response. It is passed to, and potentially modified by, each phase of the request processing life cycle (you learn about life-cycle phases in the next few slides.)

ELContext is a class that is used to evaluate an expression.

ExpressionFactory is a class that parses a String into a value expression (as in the code in the slide) or a method expression for later evaluation.

The createValueExpression() method parses expressions that evaluate to values. The expression must be first parsed, and then evaluated.

The ValueExpression class encapsulates a parsed expression, and its getValue() method evaluates the expression relative to the provided context, and returns the resulting value.