Commits

Anonymous committed 0360ba7

WW-3262 merge params extracted from matcher

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@2062e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits e8787f7

Comments (0)

Files changed (2)

File core/pom.xml

                                     <artifact>commons-lang:commons-lang</artifact>
                                     <includes>
                                         <include>org/apache/commons/lang/StringUtils.class</include>
+                                        <include>org/apache/commons/lang/math/NumberUtils.class</include>
                                         <include>org/apache/commons/lang/ObjectUtils*.class</include>
                                         <include>org/apache/commons/lang/StringEscapeUtils.class</include>
                                         <include>org/apache/commons/lang/exception/NestableRuntimeException.class</include>

File core/src/main/java/com/opensymphony/xwork2/config/impl/AbstractMatcher.java

 import java.io.Serializable;
 import java.util.*;
 
+import org.apache.commons.lang.math.NumberUtils;
+
 /**
  * <p> Matches patterns against pre-compiled wildcard expressions pulled from
  * target objects. It uses the wildcard matcher from the Apache Cocoon
      */
     protected Map<String,String> replaceParameters(Map<String, String> orig, Map<String,String> vars) {
         Map<String,String> map = new LinkedHashMap<String,String>();
+        
+        //this will set the group index references, like {1}
         for (String key : orig.keySet()) {
             map.put(key, convertParam(orig.get(key), vars));
         }
+        
+        //the values map will contain entries like name->"Lex Luthor" and 1->"Lex Luthor"
+        //now add the non-numeric values
+        for (String key: vars.keySet()) {
+            if (!NumberUtils.isNumber(key)) {
+                map.put(key, vars.get(key));
+            }
+        }
+        
         return map;
     }