public class

WebApplicationContextFacesELResolver

extends ELResolver
java.lang.Object
   ↳ ELResolver
     ↳ org.springframework.web.jsf.el.WebApplicationContextFacesELResolver

Class Overview

Special JSF 1.2 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>

Summary

Constants
String WEB_APPLICATION_CONTEXT_VARIABLE_NAME Name of the exposed WebApplicationContext variable: "webApplicationContext".
Fields
protected final Log logger Logger available to subclasses
Public Constructors
WebApplicationContextFacesELResolver()
Public Methods
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)
boolean isReadOnly(ELContext elContext, Object base, Object property)
void setValue(ELContext elContext, Object base, Object property, Object value)
Protected Methods
WebApplicationContext getWebApplicationContext(ELContext elContext)
Retrieve the WebApplicationContext reference to expose.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String WEB_APPLICATION_CONTEXT_VARIABLE_NAME

Name of the exposed WebApplicationContext variable: "webApplicationContext".

Constant Value: "webApplicationContext"

Fields

protected final Log logger

Logger available to subclasses

Public Constructors

public WebApplicationContextFacesELResolver ()

Public Methods

public Class<?> getCommonPropertyType (ELContext elContext, Object base)

public Iterator<FeatureDescriptor> getFeatureDescriptors (ELContext elContext, Object base)

public Class<?> getType (ELContext elContext, Object base, Object property)

Throws
ELException

public Object getValue (ELContext elContext, Object base, Object property)

Throws
ELException

public boolean isReadOnly (ELContext elContext, Object base, Object property)

Throws
ELException

public void setValue (ELContext elContext, Object base, Object property, Object value)

Throws
ELException

Protected Methods

protected WebApplicationContext getWebApplicationContext (ELContext elContext)

Retrieve the WebApplicationContext reference to expose.

The default implementation delegates to FacesContextUtils, returning null if no WebApplicationContext found.

Parameters
elContext the current JSF ELContext
Returns
  • the Spring web application context