mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user