Package org.springframework.web.jsf.el
Class SpringBeanFacesELResolver
java.lang.Object
jakarta.el.ELResolver
org.springframework.web.jsf.el.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>
- Since:
- 2.5
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class jakarta.el.ELResolverRESOLVABLE_AT_DESIGN_TIME, TYPE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionClass<?>getCommonPropertyType(ELContext elContext, Object base) getFeatureDescriptors(ELContext elContext, Object base) Class<?>protected WebApplicationContextgetWebApplicationContext(ELContext elContext) Retrieve the web application context to delegate bean name resolution to.booleanisReadOnly(ELContext elContext, Object base, Object property) voidMethods inherited from class jakarta.el.ELResolverconvertToType, invoke
- 
Constructor Details- 
SpringBeanFacesELResolverpublic SpringBeanFacesELResolver()
 
- 
- 
Method Details- 
getValue@Nullable public Object getValue(ELContext elContext, @Nullable Object base, Object property) throws ELException - Specified by:
- getValuein class- ELResolver
- Throws:
- ELException
 
- 
getType@Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException - Specified by:
- getTypein class- ELResolver
- Throws:
- ELException
 
- 
setValuepublic void setValue(ELContext elContext, @Nullable Object base, Object property, Object value) throws ELException - Specified by:
- setValuein class- ELResolver
- Throws:
- ELException
 
- 
isReadOnlypublic boolean isReadOnly(ELContext elContext, @Nullable Object base, Object property) throws ELException - Specified by:
- isReadOnlyin class- ELResolver
- Throws:
- ELException
 
- 
getFeatureDescriptors@Nullable public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, @Nullable Object base) - Specified by:
- getFeatureDescriptorsin class- ELResolver
 
- 
getCommonPropertyType- Specified by:
- getCommonPropertyTypein class- ELResolver
 
- 
getWebApplicationContextRetrieve the web application context to delegate bean name resolution to.The default implementation delegates to FacesContextUtils. - Parameters:
- elContext- the current JSF ELContext
- Returns:
- the Spring web application context (never null)
- See Also:
 
 
-