类 SpringBeanFacesELResolver
- java.lang.Object
- javax.el.ELResolver
- org.springframework.beans.factory.access.el.SpringBeanELResolver
- org.springframework.web.jsf.el.SpringBeanFacesELResolver
public class SpringBeanFacesELResolver extends SpringBeanELResolver
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)
字段概要
从类继承的字段 org.springframework.beans.factory.access.el.SpringBeanELResolver
logger
从类继承的字段 javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
构造器概要
构造器 构造器 说明 SpringBeanFacesELResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected BeanFactory
getBeanFactory(ELContext elContext)
This implementation delegates togetWebApplicationContext(javax.el.ELContext)
.protected WebApplicationContext
getWebApplicationContext(ELContext elContext)
Retrieve the web application context to delegate bean name resolution to.从类继承的方法 org.springframework.beans.factory.access.el.SpringBeanELResolver
getCommonPropertyType, getFeatureDescriptors, getType, getValue, isReadOnly, setValue
从类继承的方法 javax.el.ELResolver
invoke
构造器详细资料
SpringBeanFacesELResolver
public SpringBeanFacesELResolver()
方法详细资料
getBeanFactory
protected BeanFactory getBeanFactory(ELContext elContext)
This implementation delegates togetWebApplicationContext(javax.el.ELContext)
. Can be overridden to provide an arbitrary BeanFactory reference to resolve against; usually, this will be a full Spring ApplicationContext.- 指定者:
getBeanFactory
在类中SpringBeanELResolver
- 参数:
elContext
- the current JSF ELContext- 返回:
- the Spring BeanFactory (never
null
)
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)