类 SpringBeanFacesELResolver
- java.lang.Object
- javax.el.ELResolver
- org.springframework.web.jsf.el.SpringBeanFacesELResolver
public class SpringBeanFacesELResolver extends ELResolver
JSFELResolver
that delegates to the Spring rootWebApplicationContext
, 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>
- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
WebApplicationContextFacesELResolver
,FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
字段概要
从类继承的字段 javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
构造器概要
构造器 构造器 说明 SpringBeanFacesELResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Class<?>
getCommonPropertyType(ELContext elContext, Object base)
Iterator<FeatureDescriptor>
getFeatureDescriptors(ELContext elContext, Object base)
Class<?>
getType(ELContext elContext, Object base, Object property)
Object
getValue(ELContext elContext, Object base, Object property)
protected WebApplicationContext
getWebApplicationContext(ELContext elContext)
Retrieve the web application context to delegate bean name resolution to.boolean
isReadOnly(ELContext elContext, Object base, Object property)
void
setValue(ELContext elContext, Object base, Object property, Object value)
从类继承的方法 javax.el.ELResolver
convertToType, invoke
构造器详细资料
SpringBeanFacesELResolver
public SpringBeanFacesELResolver()
方法详细资料
getValue
@Nullable public Object getValue(ELContext elContext, @Nullable Object base, Object property) throws ELException
- 指定者:
getValue
在类中ELResolver
- 抛出:
ELException
getType
@Nullable public Class<?> getType(ELContext elContext, @Nullable Object base, Object property) throws ELException
- 指定者:
getType
在类中ELResolver
- 抛出:
ELException
setValue
public void setValue(ELContext elContext, @Nullable Object base, Object property, Object value) throws ELException
- 指定者:
setValue
在类中ELResolver
- 抛出:
ELException
isReadOnly
public boolean isReadOnly(ELContext elContext, @Nullable Object base, Object property) throws ELException
- 指定者:
isReadOnly
在类中ELResolver
- 抛出:
ELException
getFeatureDescriptors
@Nullable public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, @Nullable Object base)
- 指定者:
getFeatureDescriptors
在类中ELResolver
getCommonPropertyType
public Class<?> getCommonPropertyType(ELContext elContext, @Nullable Object base)
- 指定者:
getCommonPropertyType
在类中ELResolver
getWebApplicationContext
protected WebApplicationContext getWebApplicationContext(ELContext elContext)
Retrieve the web application context to delegate bean name resolution to.The default implementation delegates to FacesContextUtils.
- 参数:
elContext
- the current JSF ELContext- 返回:
- the Spring web application context (never
null
) - 另请参阅:
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)