WW-1353 Enable use of action: prefix when DMI is disabled.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@438223 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ted Nathan Husted
2006-08-29 21:27:56 +00:00
parent ef8d3af4b8
commit 37527a7d8a
2 changed files with 10 additions and 11 deletions
@@ -164,17 +164,18 @@ public class DefaultActionMapper implements ActionMapper {
put(ACTION_PREFIX, new ParameterAction() {
public void execute(String key, ActionMapping mapping) {
String name = key.substring(ACTION_PREFIX.length());
int bang = name.indexOf('!');
if (bang != -1) {
String method = name.substring(bang + 1);
mapping.setMethod(method);
name = name.substring(0, bang);
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(name);
}
});
put(REDIRECT_PREFIX, new ParameterAction() {
public void execute(String key, ActionMapping mapping) {
ServletRedirectResult redirect = new ServletRedirectResult();
@@ -208,9 +209,7 @@ public class DefaultActionMapper implements ActionMapper {
parseNameAndNamespace(uri, mapping, config);
if (allowDynamicMethodCalls) {
handleSpecialParameters(request, mapping);
}
handleSpecialParameters(request, mapping);
if (mapping.getName() == null) {
return null;
@@ -73,7 +73,7 @@ struts.serve.static.browserCache=true
### Set this to false if you wish to disable all forms of dynamic method invocation
### via the URL request. This includes URLs like foo!bar.action, as well as params
### like method:bar. See the DefaultActionMapper for more info.
### like method:bar (but not action:foo). See the DefaultActionMapper for more info.
struts.enable.DynamicMethodInvocation = true
### use alternative syntax that requires %{} in most places