类 WebApplicationContextFacesELResolver
- java.lang.Object
- javax.el.ELResolver
- org.springframework.web.jsf.el.WebApplicationContextFacesELResolver
public class WebApplicationContextFacesELResolver extends ELResolver
Special JSFELResolverthat exposes the SpringWebApplicationContextinstance under a variable named "webApplicationContext".In contrast to
SpringBeanFacesELResolver, this ELResolver variant does not resolve JSF variable names as Spring bean names. It rather exposes Spring's root WebApplicationContext itself under a special name, and is able to resolve "webApplicationContext.mySpringManagedBusinessObject" dereferences to Spring-defined beans in that application context.Configure this resolver in your
faces-config.xmlfile as follows:<application> ... <el-resolver>org.springframework.web.jsf.el.WebApplicationContextFacesELResolver</el-resolver> </application>
- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
SpringBeanFacesELResolver,FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)
字段概要
字段 修饰符和类型 字段 说明 protected LogloggerLogger available to subclassesstatic StringWEB_APPLICATION_CONTEXT_VARIABLE_NAMEName of the exposed WebApplicationContext variable: "webApplicationContext".从类继承的字段 javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
构造器概要
构造器 构造器 说明 WebApplicationContextFacesELResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Class<?>getCommonPropertyType(ELContext elContext, Object base)Iterator<FeatureDescriptor>getFeatureDescriptors(ELContext elContext, Object base)Class<?>getType(ELContext elContext, Object base, Object property)ObjectgetValue(ELContext elContext, Object base, Object property)protected WebApplicationContextgetWebApplicationContext(ELContext elContext)Retrieve theWebApplicationContextreference to expose.booleanisReadOnly(ELContext elContext, Object base, Object property)voidsetValue(ELContext elContext, Object base, Object property, Object value)从类继承的方法 javax.el.ELResolver
invoke
字段详细资料
WEB_APPLICATION_CONTEXT_VARIABLE_NAME
public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME
Name of the exposed WebApplicationContext variable: "webApplicationContext".- 另请参阅:
- 常量字段值
构造器详细资料
WebApplicationContextFacesELResolver
public WebApplicationContextFacesELResolver()
方法详细资料
getValue
public Object getValue(ELContext elContext, Object base, Object property) throws ELException
- 指定者:
getValue在类中ELResolver- 抛出:
ELException
getType
public Class<?> getType(ELContext elContext, Object base, Object property) throws ELException
- 指定者:
getType在类中ELResolver- 抛出:
ELException
setValue
public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException
- 指定者:
setValue在类中ELResolver- 抛出:
ELException
isReadOnly
public boolean isReadOnly(ELContext elContext, Object base, Object property) throws ELException
- 指定者:
isReadOnly在类中ELResolver- 抛出:
ELException
getFeatureDescriptors
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, Object base)
- 指定者:
getFeatureDescriptors在类中ELResolver
getCommonPropertyType
public Class<?> getCommonPropertyType(ELContext elContext, Object base)
- 指定者:
getCommonPropertyType在类中ELResolver
getWebApplicationContext
protected WebApplicationContext getWebApplicationContext(ELContext elContext)
Retrieve theWebApplicationContextreference to expose.The default implementation delegates to
FacesContextUtils, returningnullif noWebApplicationContextfound.- 参数:
elContext- the current JSF ELContext- 返回:
- the Spring web application context
- 另请参阅:
FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)