diff --git a/spring-webflow/src/main/java/org/springframework/webflow/action/DispatchMethodInvoker.java b/spring-webflow/src/main/java/org/springframework/webflow/action/DispatchMethodInvoker.java index e81d8a76..b1dc643f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/action/DispatchMethodInvoker.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/action/DispatchMethodInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 the original author or authors. + * Copyright 2004-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,12 +48,13 @@ class DispatchMethodInvoker { */ @SuppressWarnings("serial") private Map methodCache = new AbstractCachingMapDecorator() { + @Override public Method create(String key) { String methodName = key; try { return new MethodKey(target.getClass(), methodName, parameterTypes).getMethod(); } catch (InvalidMethodKeyException e) { - throw new MethodLookupException("Unable to resolve dispatch method " + e.getMethodKey() + throw new MethodLookupException("Unable to resolve dispatch method '" + e.getMethodKey() + "'; make sure the method name is correct and such a method is defined on targetClass " + target.getClass().getName(), e); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ActionPropertyAccessor.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ActionPropertyAccessor.java index 0710284f..f7170c3a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ActionPropertyAccessor.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ActionPropertyAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 the original author or authors. + * Copyright 2004-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,32 +28,37 @@ import org.springframework.webflow.execution.AnnotatedAction; * Spring EL Property Accessor that allows invocation of methods against a resolved Web Flow action, typically a * {@link MultiAction} in expressions. *

- * + * * @see org.springframework.webflow.action.EvaluateAction - * + * * @author Rossen Stoyanchev * @since 2.1 */ public class ActionPropertyAccessor implements PropertyAccessor { + @Override public Class[] getSpecificTargetClasses() { return new Class[] { Action.class }; } + @Override public boolean canRead(EvaluationContext context, Object target, String name) { return true; } + @Override public TypedValue read(EvaluationContext context, Object target, String name) { AnnotatedAction annotated = new AnnotatedAction((Action) target); annotated.setMethod(name); return new TypedValue(annotated); } + @Override public boolean canWrite(EvaluationContext context, Object target, String name) { return false; } + @Override public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException { throw new AccessException("The Action cannot be set with an expression."); }