[
https://issues.apache.org/jira/browse/WW-4143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13710843#comment-13710843
]
Tom Briers commented on WW-4143:
--------------------------------
Either is fine (I fixed my issue with a custom mapper) but there is already a
special treatment in the "action:" prefix for DMI:
{code}
put(ACTION_PREFIX, new ParameterAction() {
public void execute(String key, ActionMapping mapping) {
String name = key.substring(ACTION_PREFIX.length());
if (allowDynamicMethodCalls) {
int bang = name.indexOf('!');
if (bang != -1) {
String method = name.substring(bang + 1);
mapping.setMethod(method);
name = name.substring(0, bang);
}
}
mapping.setName(cleanupActionName(name));
}
});
{code}
I'm not sure how backwards compatibility can be assured for those who count on
that behavior.
> Add actionMapper that ignores prefixes
> --------------------------------------
>
> Key: WW-4143
> URL: https://issues.apache.org/jira/browse/WW-4143
> Project: Struts 2
> Issue Type: Improvement
> Components: Core Actions
> Reporter: Tom Briers
> Priority: Minor
> Fix For: 2.3.16
>
>
> The prefixes 'method:' and 'action:' are treated specially in struts2.
> The treatment for 'method:' can be deactivated by
> 'useDynamicInvocation=false' but the treatment of 'action:' cannot be
> deactivated.
> I think it would be useful if the following actionmapper is included in the
> library so people can easily deactivate all special treatment:
> {code}
> package org.apache.struts2.dispatcher.mapper;
> import org.apache.struts2.util.PrefixTrie;
> public class IgnorePrefixActionMapper
> extends DefaultActionMapper
> {
> public IgnorePrefixActionMapper()
> {
> super();
> // remove any injected prefix treatments
> prefixTrie = new PrefixTrie();
> }
> }
> {code}
> The reason I want to disable all this is that I do not want anyone to change
> the behavior of the implemented application by using these techniques.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira