[
https://issues.apache.org/struts/browse/WW-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wes Wannemacher updated WW-2323:
--------------------------------
Attachment: struts2-WW-2323.patch
I took a look at this issue and thought a patch would be easy enough to
generate, but the more I thought about it, I thought that a person using this
tag might expect more than what it currently does. This patch attempts to use
the current action mapper to resolve the best namespace/action/method combo to
execute. I'm open to feedback on this because it is a big-time hack and I was
actually surprised when the unit tests all passed.
> 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
> Attachments: struts2-WW-2323.patch
>
>
> <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 enable 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.