Commits

Anonymous committed 7c4a335

Some XMLParsers parse the xwork config file differently, resulting in broken action results
o porting over from branch_1-2

Issue Number: XW-412

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

  • Participants
  • Parent commits 31d46ee

Comments (0)

Files changed (3)

File src/java/com/opensymphony/xwork2/config/providers/XmlHelper.java

                 Element paramElement = (Element) childNode;
                 String paramName = paramElement.getAttribute("name");
 
-
-                if (paramElement.getChildNodes().item(0) != null) {
-                    String paramValue = paramElement.getChildNodes().item(0).getNodeValue();
-                    if (paramValue != null) {
-                        paramValue = paramValue.trim();
-                    } else {
-                        paramValue = "";
-                    }
-                    params.put(paramName, paramValue);
+                StringBuffer paramValue = new StringBuffer();
+                for (int j=0; j <paramElement.getChildNodes().getLength(); j++) {
+                	if (paramElement.getChildNodes().item(j) != null && 
+                			paramElement.getChildNodes().item(j).getNodeType() == Node.TEXT_NODE) {
+                		String val = paramElement.getChildNodes().item(j).getNodeValue();
+                		if (val != null) {
+                			paramValue .append(val.trim());
+                		} 
+                	}
+                }
+                String val = paramValue.toString().trim();
+                if (val.length() > 0) {
+                	params.put(paramName, val);
                 }
-
             }
         }
 

File src/test/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java

         // bar action is very simple, just two params
         params.put("foo", "17");
         params.put("bar", "23");
+        params.put("testXW412", "foo.jspa?fooID=${fooID}&something=bar");
+        params.put("testXW412Again", "something");
+
 
         ActionConfig barAction = new ActionConfig(null, SimpleAction.class, params, new HashMap(), new ArrayList());
 

File src/test/com/opensymphony/xwork2/config/providers/xwork-test-actions.xml

         <action name="Bar" class="com.opensymphony.xwork2.SimpleAction">
             <param name="foo">17</param>
             <param name="bar">23</param>
+            <param name="testXW412">foo.jspa?fooID=${fooID}&amp;something=bar</param>
+            <param name="testXW412Again">
+            		something
+            </param>
             <param name="testForXW171"></param>
         </action>