struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [6/7] struts git commit: Cleans up method name
Date Tue, 19 Apr 2016 12:44:38 GMT
Cleans up method name


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/c0270381
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/c0270381
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/c0270381

Branch: refs/heads/struts-2-3-28-1
Commit: c0270381ef70e64c8c37741e138073f421bc6ccf
Parents: 44ea0e6
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Apr 19 08:25:28 2016 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Tue Apr 19 14:26:54 2016 +0200

----------------------------------------------------------------------
 .../struts2/dispatcher/mapper/DefaultActionMapper.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/c0270381/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
b/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
index a7a1a69..024e2d3 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
@@ -136,7 +136,7 @@ public class DefaultActionMapper implements ActionMapper {
                 put(METHOD_PREFIX, new ParameterAction() {
                     public void execute(String key, ActionMapping mapping) {
                         if (allowDynamicMethodCalls) {
-                            mapping.setMethod(key.substring(METHOD_PREFIX.length()));
+                            mapping.setMethod(cleanupActionName(key.substring(METHOD_PREFIX.length())));
                         }
                     }
                 });
@@ -148,7 +148,7 @@ public class DefaultActionMapper implements ActionMapper {
                             if (allowDynamicMethodCalls) {
                                 int bang = name.indexOf('!');
                                 if (bang != -1) {
-                                    String method = name.substring(bang + 1);
+                                    String method = cleanupActionName(name.substring(bang
+ 1));
                                     mapping.setMethod(method);
                                     name = name.substring(0, bang);
                                 }
@@ -385,7 +385,7 @@ public class DefaultActionMapper implements ActionMapper {
             return rawActionName;
         } else {
             if (LOG.isWarnEnabled()) {
-                LOG.warn("Action [#0] does not match allowed action names pattern [#1], cleaning
it up!",
+                LOG.warn("Action/method [#0] does not match allowed action names pattern
[#1], cleaning it up!",
                         rawActionName, allowedActionNames);
             }
             String cleanActionName = rawActionName;
@@ -393,7 +393,7 @@ public class DefaultActionMapper implements ActionMapper {
                 cleanActionName = cleanActionName.replace(chunk, "");
             }
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Cleaned action name [#0]", cleanActionName);
+                LOG.debug("Cleaned action/method name [#0]", cleanActionName);
             }
             return cleanActionName;
         }


Mime
View raw message