Author: husted
Date: Tue Aug 29 14:27:56 2006
New Revision: 438223
URL: http://svn.apache.org/viewvc?rev=438223&view=rev
Log:
WW-1353 Enable use of action: prefix when DMI is disabled.
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java?rev=438223&r1=438222&r2=438223&view=diff
==============================================================================
---
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
(original)
+++
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
Tue Aug 29 14:27:56 2006
@@ -164,17 +164,18 @@
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 @@
parseNameAndNamespace(uri, mapping, config);
- if (allowDynamicMethodCalls) {
- handleSpecialParameters(request, mapping);
- }
+ handleSpecialParameters(request, mapping);
if (mapping.getName() == null) {
return null;
Modified:
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties?rev=438223&r1=438222&r2=438223&view=diff
==============================================================================
---
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties
(original)
+++
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties
Tue Aug 29 14:27:56 2006
@@ -73,7 +73,7 @@
### 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