1 16 package org.springframework.webflow.executor.jsf; 17 18 import javax.faces.context.FacesContext; 19 import javax.faces.el.EvaluationException; 20 import javax.faces.el.VariableResolver; 21 22 29 public class FlowVariableResolver extends VariableResolver { 30 31 34 public static final String FLOW_SCOPE_VARIABLE = "flowScope"; 35 36 39 private VariableResolver resolverDelegate; 40 41 51 public FlowVariableResolver(VariableResolver resolverDelegate) { 52 this.resolverDelegate = resolverDelegate; 53 } 54 55 58 protected final VariableResolver getResolverDelegate() { 59 return resolverDelegate; 60 } 61 62 66 public Object resolveVariable(FacesContext context, String name) throws EvaluationException { 67 if (!FLOW_SCOPE_VARIABLE.equals(name)) { 68 return resolverDelegate.resolveVariable(context, name); 69 } 70 else { 71 FlowExecutionHolder holder = FlowExecutionHolderUtils.getFlowExecutionHolder(context); 72 if (holder == null) 73 throw new EvaluationException( 74 "'flowScope' variable prefix specified, but a FlowExecution is not bound to current thread context as it should be"); 75 return holder.getFlowExecution(); 76 } 77 } 78 } | Popular Tags |