This commit is contained in:
Keith Donald
2008-03-04 23:11:22 +00:00
parent 452ba0ed0e
commit 6a0e602729
2 changed files with 12 additions and 5 deletions

View File

@@ -9,7 +9,14 @@ import javax.el.PropertyNotWritableException;
import org.springframework.webflow.engine.AnnotatedAction;
import org.springframework.webflow.execution.Action;
public class ActionExecutingELResolver extends ELResolver {
/**
* Resolves the method to invoke on a resolved Web Flow Action instance. The resolved Action is usually a
* {@link org.springframework.webflow.action.MultiAction}. Returns an AnnotatedAction wrapper around the target Action
* configured with the appropriate method dispatching rules.
*
* @author Keith Donald
*/
public class ActionMethodELResolver extends ELResolver {
public Class getCommonPropertyType(ELContext elContext, Object base) {
return Action.class;
@@ -32,9 +39,9 @@ public class ActionExecutingELResolver extends ELResolver {
if (base instanceof Action) {
Action action = (Action) base;
elContext.setPropertyResolved(true);
AnnotatedAction decorator = new AnnotatedAction(action);
decorator.setMethod((String) property);
return decorator;
AnnotatedAction annotated = new AnnotatedAction(action);
annotated.setMethod(property.toString());
return annotated;
} else {
return null;
}

View File

@@ -45,7 +45,7 @@ public class WebFlowELExpressionParser extends ELExpressionParser {
List customResolvers = new ArrayList();
customResolvers.add(new RequestContextELResolver());
customResolvers.add(new SpringBeanWebFlowELResolver());
customResolvers.add(new ActionExecutingELResolver());
customResolvers.add(new ActionMethodELResolver());
customResolvers.add(new ScopeSearchingELResolver());
ELResolver resolver = new DefaultELResolver(target, customResolvers);
return new WebFlowELContext(resolver);