This commit is contained in:
Keith Donald
2007-08-21 07:10:33 +00:00
parent 3bddd7424d
commit 04d4a78a03
3 changed files with 21 additions and 5 deletions

View File

@@ -13,14 +13,20 @@ import org.springframework.binding.expression.el.ELExpressionParser;
/**
* A JSF-aware ExpressionParser that allows JSF 1.1 managed beans to be referenced in expressions in the FlowDefinition.
* @author Jeremy Grelle
*
*/
public class Jsf11ELExpressionParser extends ELExpressionParser {
/**
* Creates a new JSF 1.1 compatible expression parser
* @param expressionFactory the unified EL expression factory implementation
*/
public Jsf11ELExpressionParser(ExpressionFactory expressionFactory) {
super(expressionFactory, new Jsf11ELContextFactory());
}
/**
* Inner helper class that plus in the EL Resolver that resolves expressions using JSF 1.1 APIs.
*/
private static class Jsf11ELContextFactory extends DefaultELContextFactory {
public ELContext getEvaluationContext(Object target) {
@@ -29,7 +35,7 @@ public class Jsf11ELExpressionParser extends ELExpressionParser {
private static class Jsf11ELContext extends ELContext {
ELResolver baseResolver;
private ELResolver baseResolver;
public Jsf11ELContext(FacesContext context) {
baseResolver = new Jsf11ELResolverAdapter(context);

View File

@@ -16,13 +16,16 @@ import javax.faces.el.VariableResolver;
/**
* An adapter for using JSF 1.1 {@link VariableResolver}s and {@link PropertyResolver}s in an {@link ELContext}.
* @author Jeremy Grelle
*
* @author Jeremy Grelle0
*/
public class Jsf11ELResolverAdapter extends ELResolver {
private FacesContext facesContext;
/**
* Creates a new adapter that adapts JSF 1.1 EL constructs to the Unified EL Resolver construct.
* @param facesContext the current faces context
*/
public Jsf11ELResolverAdapter(FacesContext facesContext) {
this.facesContext = facesContext;
}

View File

@@ -10,14 +10,21 @@ import org.springframework.binding.expression.el.ELExpressionParser;
/**
* A JSF-aware ExpressionParser that allows JSF 1.2 managed beans to be referenced in expressions in the FlowDefinition.
* @author Jeremy Grelle
*
*/
public class Jsf12ELExpressionParser extends ELExpressionParser {
/**
* Creates a JSF 1.2 expression parser
* @param expressionFactory the unified EL expression factory implementation to use
*/
public Jsf12ELExpressionParser(ExpressionFactory expressionFactory) {
super(expressionFactory, new Jsf12ELContextFactory());
}
/**
* Simple little helper that grabs the current EL context from the faces context to support EL expression
* evaluation.
*/
private static class Jsf12ELContextFactory extends DefaultELContextFactory {
public ELContext getEvaluationContext(Object target) {
return FacesContext.getCurrentInstance().getELContext();