EL Expression Evaluation in JSF

For a given EL #{myBean.myProperty}, following is the steps that are executed by the EL expression evaluator:

  1. Breaks the EL in two part:The bean is the searched starting from the closest scope to more broader scope.
    1. First part is the bean name – myBean
    2. Second part is the property in the bean – myProperty.
  2. First the bean is searched in request scope.
  3. If step 3 doesn’t return the bean, then it is searched in view scope.
  4. If step 4 doesn’t return the bean, then it is searched in session scope.
  5. If step 5 doesn’t return the bean, then it is searched in the application scope.
  6. If step 6 doesn’t return the bean, a Runtime Exception is thrown, stating bean cannot be found.
  7. If bean is found in any of the step from 3 to 6, property is searched in the bean. N.B: The moment bean is found, search for bean will stop immediately.
  8. If property is found its value is evaluated.
  9. If property is not found, a Runtime Exception is thrown.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s