public class WebApplicationContextFacesELResolver
extends javax.el.ELResolver
ELResolver that exposes the Spring
WebApplicationContext instance 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.xml file as follows:
<application> ... <el-resolver>org.springframework.web.jsf.el.WebApplicationContextFacesELResolver</el-resolver> </application>
SpringBeanFacesELResolver,
FacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses
|
static String |
WEB_APPLICATION_CONTEXT_VARIABLE_NAME
Name of the exposed WebApplicationContext variable: "webApplicationContext".
|
| Constructor and Description |
|---|
WebApplicationContextFacesELResolver() |
| Modifier and Type | Method and Description |
|---|---|
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 WebApplicationContext reference to expose.
|
boolean |
isReadOnly(javax.el.ELContext elContext,
Object base,
Object property) |
void |
setValue(javax.el.ELContext elContext,
Object base,
Object property,
Object value) |
public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME
protected final org.apache.commons.logging.Log logger
public WebApplicationContextFacesELResolver()
public Object getValue(javax.el.ELContext elContext, Object base, Object property) throws javax.el.ELException
getValue in class javax.el.ELResolverjavax.el.ELExceptionpublic Class<?> getType(javax.el.ELContext elContext, Object base, Object property) throws javax.el.ELException
getType in class javax.el.ELResolverjavax.el.ELExceptionpublic void setValue(javax.el.ELContext elContext,
Object base,
Object property,
Object value)
throws javax.el.ELException
setValue in class javax.el.ELResolverjavax.el.ELExceptionpublic boolean isReadOnly(javax.el.ELContext elContext,
Object base,
Object property)
throws javax.el.ELException
isReadOnly in class javax.el.ELResolverjavax.el.ELExceptionpublic Iterator<FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext elContext, Object base)
getFeatureDescriptors in class javax.el.ELResolverpublic Class<?> getCommonPropertyType(javax.el.ELContext elContext, Object base)
getCommonPropertyType in class javax.el.ELResolverprotected WebApplicationContext getWebApplicationContext(javax.el.ELContext elContext)
The default implementation delegates to FacesContextUtils,
returning null if no WebApplicationContext found.
elContext - the current JSF ELContextFacesContextUtils.getWebApplicationContext(javax.faces.context.FacesContext)Copyright © 2015. All rights reserved.