|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.el.ELResolver org.springframework.web.jsf.el.DelegatingFacesELResolver
public class DelegatingFacesELResolver
JSF 1.2 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.DelegatingFacesELResolver</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>
WebApplicationContextVariableResolver
,
FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
Field Summary | |
---|---|
protected Log |
logger
Logger available to subclasses |
Fields inherited from class javax.el.ELResolver |
---|
RESOLVABLE_AT_DESIGN_TIME, TYPE |
Constructor Summary | |
---|---|
DelegatingFacesELResolver()
|
Method Summary | |
---|---|
protected BeanFactory |
getBeanFactory(javax.el.ELContext elContext)
Retrieve the Spring BeanFactory to delegate bean name resolution to. |
Class<?> |
getCommonPropertyType(javax.el.ELContext elContext,
Object base)
|
Iterator<FeatureDescriptor> |
getFeatureDescriptors(javax.el.ELContext elContext,
Object base)
|
Class<?> |
getType(javax.el.ELContext elContext,
Object base,
Object property)
|
Object |
getValue(javax.el.ELContext elContext,
Object base,
Object property)
|
protected WebApplicationContext |
getWebApplicationContext(javax.el.ELContext elContext)
Retrieve the web application context to delegate bean name resolution to. |
boolean |
isReadOnly(javax.el.ELContext elContext,
Object base,
Object property)
|
void |
setValue(javax.el.ELContext elContext,
Object base,
Object property,
Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public DelegatingFacesELResolver()
Method Detail |
---|
public Object getValue(javax.el.ELContext elContext, Object base, Object property) throws javax.el.ELException
getValue
in class javax.el.ELResolver
javax.el.ELException
public Class<?> getType(javax.el.ELContext elContext, Object base, Object property) throws javax.el.ELException
getType
in class javax.el.ELResolver
javax.el.ELException
public void setValue(javax.el.ELContext elContext, Object base, Object property, Object value) throws javax.el.ELException
setValue
in class javax.el.ELResolver
javax.el.ELException
public boolean isReadOnly(javax.el.ELContext elContext, Object base, Object property) throws javax.el.ELException
isReadOnly
in class javax.el.ELResolver
javax.el.ELException
public Iterator<FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext elContext, Object base)
getFeatureDescriptors
in class javax.el.ELResolver
public Class<?> getCommonPropertyType(javax.el.ELContext elContext, Object base)
getCommonPropertyType
in class javax.el.ELResolver
protected BeanFactory getBeanFactory(javax.el.ELContext elContext)
The default implementation delegates to getWebApplicationContext
.
Can be overridden to provide an arbitrary BeanFactory reference to resolve
against; usually, this will be a full Spring ApplicationContext.
elContext
- the current JSF ELContext
null
)getWebApplicationContext(javax.el.ELContext)
protected WebApplicationContext getWebApplicationContext(javax.el.ELContext elContext)
The default implementation delegates to FacesContextUtils.
elContext
- the current JSF ELContext
null
)FacesContextUtils.getRequiredWebApplicationContext(javax.faces.context.FacesContext)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |