Repository: struts
Updated Branches:
  refs/heads/develop 5649ff1ac -> 791364cf6


WW-4493 Allows to pass parameters witch dashes in names


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

Branch: refs/heads/develop
Commit: 791364cf6d97528ec75b8859450204150d55ed5e
Parents: 5649ff1
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Thu Apr 30 08:27:27 2015 +0200
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Thu Apr 30 08:27:27 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/struts2/components/Component.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/791364cf/core/src/main/java/org/apache/struts2/components/Component.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/Component.java 
b/core/src/main/java/org/apache/struts2/components/Component.java
index 15cc698..62e07ee 100644
--- a/core/src/main/java/org/apache/struts2/components/Component.java
+++ b/core/src/main/java/org/apache/struts2/components/Component.java
@@ -434,7 +434,7 @@ public class Component {
     /**
      * Pushes this component's parameter Map as well as the component itself 
on to the stack
      * and then copies the supplied parameters over. Because the component's 
parameter Map is
-     * pushed before the component itself, any key-value pair that can't be 
assigned to componet
+     * pushed before the component itself, any key-value pair that can't be 
assigned to component
      * will be set in the parameters Map.
      *
      * @param params  the parameters to copy.
@@ -446,7 +446,15 @@ public class Component {
             for (Object o : params.entrySet()) {
                 Map.Entry entry = (Map.Entry) o;
                 String key = (String) entry.getKey();
-                stack.setValue(key, entry.getValue());
+
+                if (key.indexOf('-') >= 0) {
+                    // UI component attributes may contain hypens (e.g. 
data-ajax), but ognl
+                    // can't handle that, and there can't be a component 
property with a hypen
+                    // so into the parameters map it goes. See WW-4493
+                    parameters.put(key, entry.getValue());
+                } else {
+                    stack.setValue(key, entry.getValue());
+                }
             }
         } finally {
             stack.pop();

Reply via email to