ActionComponent does not respect struts.enable.DynamicMethodInvocation=false
----------------------------------------------------------------------------
Key: WW-2323
URL: https://issues.apache.org/struts/browse/WW-2323
Project: Struts 2
Issue Type: Bug
Components: Core Actions
Affects Versions: 2.0.9
Environment: Windows XP SP2, Tomcat
Reporter: Bob Tiernay
<s:action name="xxx!yyy"> will always attempt to find an action with name "xxx"
and invoke it's method "yyy". This is a result of
org.apache.struts2.components.ActionComponent's executeAction method:
...
// handle "name!method" convention.
final String actionName;
final String methodName;
int exclamation = actualName.lastIndexOf("!");
if (exclamation != -1) {
actionName = actualName.substring(0, exclamation);
methodName = actualName.substring(exclamation + 1);
} else {
actionName = actualName;
methodName = null;
}
...
Note that the first branch in the if statement is *not* correct behavior in the
case that struts.enable.DynamicMethodInvocation has been set to false in
struts.properties.
This bug appears to be the result of an incomplete backwards compatibility
support, added to enbale the old webwork ! convention. This was a notable
change documented here:
http://struts.apache.org/2.x/docs/key-changes-from-webwork-2.html
The proposed solution is to respect the value
struts.enable.DynamicMethodInvocation in ActionComponent so that both values of
true and false can be used consistently across the framework.
(See also Form component and ServletUrlRenderer for their use of
struts.enable.DynamicMethodInvocation)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.