spring-framework / org.springframework.web.jsf.el / SpringBeanFacesELResolver

SpringBeanFacesELResolver

open class SpringBeanFacesELResolver : ELResolver

JSF ELResolver that delegates to the Spring root WebApplicationContext, resolving name references to Spring-defined beans.

Configure this resolver in your faces-config.xml file as follows:

 <application> ... <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> </application>
All your JSF expressions can then implicitly refer to the names of Spring-managed service layer beans, for example in property values of JSF-managed beans:
 <managed-bean> <managed-bean-name>myJsfManagedBean</managed-bean-name> <managed-bean-class>example.MyJsfManagedBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>mySpringManagedBusinessObject</property-name> <value>#{mySpringManagedBusinessObject}</value> </managed-property> </managed-bean>
with "mySpringManagedBusinessObject" defined as Spring bean in applicationContext.xml:
 <bean id="mySpringManagedBusinessObject" class="example.MySpringManagedBusinessObject"> ... </bean>

Author
Juergen Hoeller

Since
2.5

See Also
WebApplicationContextFacesELResolverorg.springframework.web.jsf.FacesContextUtils#getRequiredWebApplicationContext

Constructors

<init>

SpringBeanFacesELResolver()

JSF ELResolver that delegates to the Spring root WebApplicationContext, resolving name references to Spring-defined beans.

Configure this resolver in your faces-config.xml file as follows:

 <application> ... <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> </application>
All your JSF expressions can then implicitly refer to the names of Spring-managed service layer beans, for example in property values of JSF-managed beans:
 <managed-bean> <managed-bean-name>myJsfManagedBean</managed-bean-name> <managed-bean-class>example.MyJsfManagedBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>mySpringManagedBusinessObject</property-name> <value>#{mySpringManagedBusinessObject}</value> </managed-property> </managed-bean>
with "mySpringManagedBusinessObject" defined as Spring bean in applicationContext.xml:
 <bean id="mySpringManagedBusinessObject" class="example.MySpringManagedBusinessObject"> ... </bean>

Functions

getCommonPropertyType

open fun getCommonPropertyType(elContext: ELContext, base: Any): Class<*>

getFeatureDescriptors

open fun getFeatureDescriptors(elContext: ELContext, base: Any): MutableIterator<FeatureDescriptor>

getType

open fun getType(elContext: ELContext, base: Any, property: Any): Class<*>

getValue

open fun getValue(elContext: ELContext, base: Any, property: Any): Any

isReadOnly

open fun isReadOnly(elContext: ELContext, base: Any, property: Any): Boolean

setValue

open fun setValue(elContext: ELContext, base: Any, property: Any, value: Any): Unit