You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2008/01/23 14:33:05 UTC
[jira] Commented: (WW-2323) ActionComponent does not respect
struts.enable.DynamicMethodInvocation=false
[ https://issues.apache.org/struts/browse/WW-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43067#action_43067 ]
Don Brown commented on WW-2323:
-------------------------------
What cases would this patch not work for? Looking at it, I had some minor changes (never use Dispatcher.getInstance(), have your object injected instead), but otherwise, I thought it was an interesting way to ensure the action/method resolution code happens in one place, something that always bothered me about the action tag.
> 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
> Fix For: 2.1.1
>
> 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.