You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2016/05/04 09:20:50 UTC

[1/7] struts git commit: Upgrades OGNL to the latest version

Repository: struts
Updated Branches:
  refs/heads/master cb5e19723 -> f238cf4f1


Upgrades OGNL to the latest version


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

Branch: refs/heads/master
Commit: 0bde27169a61b9d784ff9bc355d189ba2d3700ea
Parents: cb5e197
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed May 4 09:06:36 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:06:36 2016 +0200

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/0bde2716/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8a24fd0..ffd84c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
     <properties>
         <currentVersion>${project.version}</currentVersion>
         <struts2.springPlatformVersion>4.1.6.RELEASE</struts2.springPlatformVersion>
-        <ognl.version>3.1.2</ognl.version>
+        <ognl.version>3.1.4</ognl.version>
         <asm.version>3.3</asm.version>
         <asm5.version>5.0.2</asm5.version>
         <tiles.version>3.0.5</tiles.version>


[2/7] struts git commit: Introduces more restrictive SMI

Posted by lu...@apache.org.
Introduces more restrictive SMI


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

Branch: refs/heads/master
Commit: 9ac863b339a3513dabd417f4be8a802418a997ba
Parents: 0bde271
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed May 4 09:15:06 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:15:06 2016 +0200

----------------------------------------------------------------------
 .../xwork2/config/entities/ActionConfig.java    | 16 +++++--
 .../xwork2/config/entities/AllowedMethods.java  | 37 +++++++++++-----
 .../xwork2/config/impl/ActionConfigMatcher.java |  1 +
 .../providers/XmlConfigurationProvider.java     |  1 +
 .../config/entities/AllowedMethodsTest.java     | 46 +++++++++++++++++---
 5 files changed, 80 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/9ac863b3/core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java b/core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java
index e12a86b..3e921f4 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java
@@ -44,6 +44,7 @@ public class ActionConfig extends Located implements Serializable {
     public static final String DEFAULT_METHOD = "execute";
     public static final String WILDCARD = "*";
     public static final String REGEX_WILDCARD = "regex:.*";
+    public static final String DEFAULT_METHOD_REGEX = "([A-Za-z0-9_$]*)";
 
     protected List<InterceptorMapping> interceptors; // a list of interceptorMapping Objects eg. List<InterceptorMapping>
     protected Map<String,String> params;
@@ -53,6 +54,7 @@ public class ActionConfig extends Located implements Serializable {
     protected String methodName;
     protected String packageName;
     protected String name;
+    protected boolean strictMethodInvocation;
     protected AllowedMethods allowedMethods;
 
     protected ActionConfig(String packageName, String name, String className) {
@@ -63,7 +65,6 @@ public class ActionConfig extends Located implements Serializable {
         results = new LinkedHashMap<>();
         interceptors = new ArrayList<>();
         exceptionMappings = new ArrayList<>();
-        allowedMethods = AllowedMethods.build(new HashSet<>(Collections.singletonList(DEFAULT_METHOD)));
     }
 
     /**
@@ -80,7 +81,7 @@ public class ActionConfig extends Located implements Serializable {
         this.interceptors = new ArrayList<>(orig.interceptors);
         this.results = new LinkedHashMap<>(orig.results);
         this.exceptionMappings = new ArrayList<>(orig.exceptionMappings);
-        this.allowedMethods = AllowedMethods.build(orig.allowedMethods.list());
+        this.allowedMethods = orig.allowedMethods;
         this.location = orig.location;
     }
 
@@ -132,6 +133,10 @@ public class ActionConfig extends Located implements Serializable {
         return method.equals(methodName != null ? methodName : DEFAULT_METHOD) || allowedMethods.isAllowed(method);
     }
 
+    public boolean isStrictMethodInvocation() {
+        return strictMethodInvocation;
+    }
+
     @Override public boolean equals(Object o) {
         if (this == o) {
             return true;
@@ -328,12 +333,17 @@ public class ActionConfig extends Located implements Serializable {
             return this;
         }
 
+        public Builder setStrictMethodInvocation(boolean strictMethodInvocation) {
+            target.strictMethodInvocation = strictMethodInvocation;
+            return this;
+        }
+
         public ActionConfig build() {
             target.params = Collections.unmodifiableMap(target.params);
             target.results = Collections.unmodifiableMap(target.results);
             target.interceptors = Collections.unmodifiableList(target.interceptors);
             target.exceptionMappings = Collections.unmodifiableList(target.exceptionMappings);
-            target.allowedMethods = AllowedMethods.build(allowedMethods);
+            target.allowedMethods = AllowedMethods.build(target.strictMethodInvocation, allowedMethods, DEFAULT_METHOD_REGEX);
 
             ActionConfig result = target;
             target = new ActionConfig(target);

http://git-wip-us.apache.org/repos/asf/struts/blob/9ac863b3/core/src/main/java/com/opensymphony/xwork2/config/entities/AllowedMethods.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/entities/AllowedMethods.java b/core/src/main/java/com/opensymphony/xwork2/config/entities/AllowedMethods.java
index 22fea12..d7741da 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/entities/AllowedMethods.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/entities/AllowedMethods.java
@@ -28,44 +28,51 @@ public class AllowedMethods {
     private static final Logger LOG = LogManager.getLogger(AllowedMethods.class);
 
     private Set<AllowedMethod> allowedMethods;
+    private final boolean strictMethodInvocation;
+    private String defaultRegex;
 
-    public static AllowedMethods build(Set<String> methods) {
+    public static AllowedMethods build(boolean strictMethodInvocation, Set<String> methods, String defaultRegex) {
 
         Set<AllowedMethod> allowedMethods = new HashSet<>();
         for (String method : methods) {
             boolean isPattern = false;
+            StringBuilder methodPattern = new StringBuilder();
             int len = method.length();
-            StringBuilder ret = new StringBuilder();
             char c;
             for (int x = 0; x < len; x++) {
                 c = method.charAt(x);
                 if (x < len - 2 && c == '{' && '}' == method.charAt(x + 2)) {
-                    ret.append("(.*)");
+                    methodPattern.append(defaultRegex);
                     isPattern = true;
                     x += 2;
                 } else {
-                    ret.append(c);
+                    methodPattern.append(c);
                 }
             }
-            if (isPattern && !method.startsWith("regex:")) {
-                allowedMethods.add(new PatternAllowedMethod(ret.toString(), method));
+
+            if (isPattern && !method.startsWith("regex:") && !strictMethodInvocation) {
+                allowedMethods.add(new PatternAllowedMethod(methodPattern.toString(), method));
             } else if (method.startsWith("regex:")) {
                 String pattern = method.substring(method.indexOf(":") + 1);
                 allowedMethods.add(new PatternAllowedMethod(pattern, method));
-            } else if (method.contains("*") && !method.startsWith("regex:")) {
-                String pattern = method.replaceAll("\\*", "(.*)");
+            } else if (method.contains("*") && !method.startsWith("regex:") && !strictMethodInvocation) {
+                String pattern = method.replace("*", defaultRegex);
                 allowedMethods.add(new PatternAllowedMethod(pattern, method));
+            } else if (!isPattern) {
+                allowedMethods.add(new LiteralAllowedMethod(method));
             } else {
-                allowedMethods.add(new LiteralAllowedMethod(ret.toString()));
+                LOG.trace("Ignoring method name: [{}] when SMI is set to [{}]", method, strictMethodInvocation);
             }
         }
 
         LOG.debug("Defined allowed methods: {}", allowedMethods);
 
-        return new AllowedMethods(allowedMethods);
+        return new AllowedMethods(strictMethodInvocation, allowedMethods, defaultRegex);
     }
 
-    private AllowedMethods(Set<AllowedMethod> methods) {
+    private AllowedMethods(boolean strictMethodInvocation, Set<AllowedMethod> methods, String defaultRegex) {
+        this.strictMethodInvocation = strictMethodInvocation;
+        this.defaultRegex = defaultRegex;
         this.allowedMethods = Collections.unmodifiableSet(methods);
     }
 
@@ -86,6 +93,14 @@ public class AllowedMethods {
         return result;
     }
 
+    public String getDefaultRegex() {
+        return defaultRegex;
+    }
+
+    public boolean isStrictMethodInvocation() {
+        return strictMethodInvocation;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/struts/blob/9ac863b3/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java b/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
index 2a2f0ed..07a8c46 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
@@ -115,6 +115,7 @@ public class ActionConfigMatcher extends AbstractMatcher<ActionConfig> implement
                 .methodName(methodName)
                 .addParams(params)
                 .addResultConfigs(results)
+                .setStrictMethodInvocation(orig.isStrictMethodInvocation())
                 .addAllowedMethod(orig.getAllowedMethods())
                 .addInterceptors(orig.getInterceptors())
                 .addExceptionMappings(exs)

http://git-wip-us.apache.org/repos/asf/struts/blob/9ac863b3/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index 6075be2..c87cbea 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -464,6 +464,7 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
                 .addInterceptors(interceptorList)
                 .addExceptionMappings(exceptionMappings)
                 .addParams(XmlHelper.getParams(actionElement))
+                .setStrictMethodInvocation(packageContext.isStrictMethodInvocation())
                 .addAllowedMethod(allowedMethods)
                 .location(location)
                 .build();

http://git-wip-us.apache.org/repos/asf/struts/blob/9ac863b3/core/src/test/java/com/opensymphony/xwork2/config/entities/AllowedMethodsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/config/entities/AllowedMethodsTest.java b/core/src/test/java/com/opensymphony/xwork2/config/entities/AllowedMethodsTest.java
index 607a9dc..adb8935 100644
--- a/core/src/test/java/com/opensymphony/xwork2/config/entities/AllowedMethodsTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/config/entities/AllowedMethodsTest.java
@@ -14,7 +14,7 @@ public class AllowedMethodsTest extends TestCase {
         literals.add(method);
 
         // when
-        AllowedMethods allowedMethods = AllowedMethods.build(literals);
+        AllowedMethods allowedMethods = AllowedMethods.build(false, literals, ActionConfig.DEFAULT_METHOD_REGEX);
 
         // then
         assertEquals(1, allowedMethods.list().size());
@@ -22,14 +22,14 @@ public class AllowedMethodsTest extends TestCase {
         assertFalse(allowedMethods.isAllowed("someOtherMethod"));
     }
 
-    public void testWidlcardMethods() throws Exception {
+    public void testWildcardMethodsWithNoSMI() throws Exception {
         // given
         String method = "my{1}";
         Set<String> literals = new HashSet<>();
         literals.add(method);
 
         // when
-        AllowedMethods allowedMethods = AllowedMethods.build(literals);
+        AllowedMethods allowedMethods = AllowedMethods.build(false, literals, ActionConfig.DEFAULT_METHOD_REGEX);
 
         // then
         assertEquals(1, allowedMethods.list().size());
@@ -37,14 +37,30 @@ public class AllowedMethodsTest extends TestCase {
         assertFalse(allowedMethods.isAllowed("someOtherMethod"));
     }
 
-    public void testWidlcardWithStarMethods() throws Exception {
+    public void testWildcardMethodsWithSMI() throws Exception {
         // given
-        String method = "cancel*";
+        Set<String> literals = new HashSet<>();
+        literals.add("my{1}");
+        literals.add("myMethod");
+
+        // when
+        AllowedMethods allowedMethods = AllowedMethods.build(true, literals, ActionConfig.DEFAULT_METHOD_REGEX);
+
+        // then
+        assertEquals(1, allowedMethods.list().size());
+        assertFalse(allowedMethods.isAllowed("my{1}"));
+        assertTrue(allowedMethods.isAllowed("myMethod"));
+        assertFalse(allowedMethods.isAllowed("someOtherMethod"));
+    }
+
+    public void testWildcardWithStarMethodsWithNoSMI() throws Exception {
+        // given
+        String method = "cancel*Action*";
         Set<String> literals = new HashSet<>();
         literals.add(method);
 
         // when
-        AllowedMethods allowedMethods = AllowedMethods.build(literals);
+        AllowedMethods allowedMethods = AllowedMethods.build(false, literals, ActionConfig.DEFAULT_METHOD_REGEX);
 
         // then
         assertEquals(1, allowedMethods.list().size());
@@ -52,6 +68,22 @@ public class AllowedMethodsTest extends TestCase {
         assertFalse(allowedMethods.isAllowed("startEvent"));
     }
 
+    public void testWildcardWithStarMethodsWithSMI() throws Exception {
+        // given
+        String method = "cancel*";
+        Set<String> literals = new HashSet<>();
+        literals.add(method);
+
+        // when
+        AllowedMethods allowedMethods = AllowedMethods.build(true, literals, ActionConfig.DEFAULT_METHOD_REGEX);
+
+        // then
+        assertEquals(1, allowedMethods.list().size());
+        assertTrue(allowedMethods.isAllowed("cancel*"));
+        assertFalse(allowedMethods.isAllowed("cancelAction"));
+        assertFalse(allowedMethods.isAllowed("startEvent"));
+    }
+
     public void testRegexMethods() throws Exception {
         // given
         String method = "regex:my([a-zA-Z].*)";
@@ -59,7 +91,7 @@ public class AllowedMethodsTest extends TestCase {
         literals.add(method);
 
         // when
-        AllowedMethods allowedMethods = AllowedMethods.build(literals);
+        AllowedMethods allowedMethods = AllowedMethods.build(true, literals, ActionConfig.DEFAULT_METHOD_REGEX);
 
         // then
         assertEquals(1, allowedMethods.list().size());


[5/7] struts git commit: Drops defining location via request

Posted by lu...@apache.org.
Drops defining location via request


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

Branch: refs/heads/master
Commit: 6bd694b7980494c12d49ca1bf39f12aec3e03e2f
Parents: c9c2137
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Apr 18 20:39:05 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:19:18 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/struts2/views/xslt/XSLTResult.java   | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/6bd694b7/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java b/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
index 5ebbf67..5dfd5fb 100644
--- a/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
+++ b/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
@@ -404,12 +404,7 @@ public class XSLTResult implements Result {
                 ServletActionContext.getServletContext());
     }
 
-    protected Templates getTemplates(String path) throws TransformerException, IOException {
-        String pathFromRequest = ServletActionContext.getRequest().getParameter("xslt.location");
-
-        if (pathFromRequest != null)
-            path = pathFromRequest;
-
+    protected Templates getTemplates(final String path) throws TransformerException, IOException {
         if (path == null)
             throw new TransformerException("Stylesheet path is null");
 


[7/7] struts git commit: Uses isSequence flag to block chained expressions

Posted by lu...@apache.org.
Uses isSequence flag to block chained expressions


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

Branch: refs/heads/master
Commit: f238cf4f1091be19fbcfd086b042c86a1bcaa7fc
Parents: 016b8ee
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Apr 18 20:38:27 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:20:04 2016 +0200

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/ognl/OgnlUtil.java  |  6 +++---
 .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java   | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f238cf4f/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index 679c804..562b6fc 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -287,7 +287,7 @@ public class OgnlUtil {
         compileAndExecute(name, context, new OgnlTask<Void>() {
             public Void execute(Object tree) throws OgnlException {
                 if (isEvalExpression(tree, context)) {
-                    throw new OgnlException("Eval expression cannot be used as parameter name");
+                    throw new OgnlException("Eval expression/chained expressions cannot be used as parameter name");
                 }
                 Ognl.setValue(tree, context, root, value);
                 return null;
@@ -303,7 +303,7 @@ public class OgnlUtil {
             if (context!=null && context instanceof OgnlContext) {
                 ognlContext = (OgnlContext) context;
             }
-            return node.isEvalChain(ognlContext);
+            return node.isEvalChain(ognlContext) || node.isSequence(ognlContext);
         }
         return false;
     }
@@ -360,7 +360,7 @@ public class OgnlUtil {
     
     private void checkEnableEvalExpression(Object tree, Map<String, Object> context) throws OgnlException {
         if (!enableEvalExpression && isEvalExpression(tree, context)) {
-            throw new OgnlException("Eval expressions has been disabled!");
+            throw new OgnlException("Eval expressions/chained expressions have been disabled!");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/struts/blob/f238cf4f/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
index 1ccdc4a..339d603 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
@@ -744,6 +744,21 @@ public class OgnlUtilTest extends XWorkTestCase {
         assertEquals(expected.getMessage(), "Method \"getRuntime\" failed for object class java.lang.Runtime");
     }
 
+    public void testBlockSequenceOfExpressions() throws Exception {
+        Foo foo = new Foo();
+
+        Exception expected = null;
+        try {
+            ognlUtil.setValue("#booScope=@myclass@DEFAULT_SCOPE,#bootScope.init()", ognlUtil.createDefaultContext(foo), foo, true);
+            fail();
+        } catch (OgnlException e) {
+            expected = e;
+        }
+        assertNotNull(expected);
+        assertSame(OgnlException.class, expected.getClass());
+        assertEquals(expected.getMessage(), "Eval expressions/chained expressions have been disabled!");
+    }
+
     public static class Email {
         String address;
 


[3/7] struts git commit: Cleans up method name

Posted by lu...@apache.org.
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/6d7ac40d
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6d7ac40d
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6d7ac40d

Branch: refs/heads/master
Commit: 6d7ac40dcede1793a4534a3dc249fd562d495e8c
Parents: 9ac863b
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Apr 29 08:40:03 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:16:44 2016 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/struts2/rest/RestActionMapper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/6d7ac40d/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
index f1fc41a..678a6f3 100644
--- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
+++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
@@ -320,7 +320,7 @@ public class RestActionMapper extends DefaultActionMapper {
 
             mapping.setName(actionName);
             if (allowDynamicMethodCalls) {
-                mapping.setMethod(actionMethod);
+                mapping.setMethod(cleanupActionName(actionMethod));
             } else {
                 mapping.setMethod(null);
             }


[4/7] struts git commit: Cleans up method name

Posted by lu...@apache.org.
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/c9c21378
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/c9c21378
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/c9c21378

Branch: refs/heads/master
Commit: c9c21378f2fb2ff21355c128c45e106ebd87ad7c
Parents: 6d7ac40
Author: Lukasz Lenart <lu...@apache.org>
Authored: Tue Apr 19 08:25:28 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:18:41 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/struts/blob/c9c21378/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 95ab0d5..f30e0fd 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);
                                 }


[6/7] struts git commit: Adds additional blocked classes

Posted by lu...@apache.org.
Adds additional blocked classes


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

Branch: refs/heads/master
Commit: 016b8eedd5ca47fce95e2a16069e640e3842906d
Parents: 6bd694b
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Apr 18 20:38:49 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed May 4 09:19:48 2016 +0200

----------------------------------------------------------------------
 core/src/main/resources/struts-default.xml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/016b8eed/core/src/main/resources/struts-default.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/struts-default.xml b/core/src/main/resources/struts-default.xml
index 4c1361b..e4090a5 100644
--- a/core/src/main/resources/struts-default.xml
+++ b/core/src/main/resources/struts-default.xml
@@ -50,6 +50,8 @@
                 ognl.OgnlContext,
                 ognl.ClassResolver,
                 ognl.TypeConverter,
+                ognl.MemberAccess,
+                ognl.DefaultMemberAccess,
                 com.opensymphony.xwork2.ognl.SecurityMemberAccess,
                 com.opensymphony.xwork2.ActionContext" />