Class JsfManagedBeanPropertyAccessor

java.lang.Object
org.springframework.faces.webflow.JsfManagedBeanPropertyAccessor
All Implemented Interfaces:
org.springframework.expression.PropertyAccessor

public class JsfManagedBeanPropertyAccessor extends Object implements org.springframework.expression.PropertyAccessor

Spring EL PropertyAccessor that checks request, session, and application scopes for existing JSF-managed beans. This allows traditional JSF-managed beans (defined in faces-config.xml) to be resolved through expressions in a flow definition.

The preferred approach is to instead use Spring to configure such beans, but this is meant to ease migration for users with existing JSF artifacts. This resolver will delegate to a temporary FacesContext so that JSF managed bean initialization will be triggered if the bean has not already been initialized by JSF.

Source code adapted from JsfManagedBeanResolver.

Since:
2.1
Author:
Jeremy Grelle, Rossen Stoyanchev
  • Constructor Details

    • JsfManagedBeanPropertyAccessor

      public JsfManagedBeanPropertyAccessor()
  • Method Details

    • getSpecificTargetClasses

      public Class<?>[] getSpecificTargetClasses()
      Specified by:
      getSpecificTargetClasses in interface org.springframework.expression.PropertyAccessor
    • canRead

      public boolean canRead(org.springframework.expression.EvaluationContext context, Object target, String name)
      Specified by:
      canRead in interface org.springframework.expression.PropertyAccessor
    • read

      public org.springframework.expression.TypedValue read(org.springframework.expression.EvaluationContext context, Object target, String name)
      Specified by:
      read in interface org.springframework.expression.PropertyAccessor
    • canWrite

      public boolean canWrite(org.springframework.expression.EvaluationContext context, Object target, String name)
      Specified by:
      canWrite in interface org.springframework.expression.PropertyAccessor
    • write

      public void write(org.springframework.expression.EvaluationContext context, Object target, String name, Object newValue)
      Specified by:
      write in interface org.springframework.expression.PropertyAccessor