Commits

jcarreira  committed 235f8d5

XW-96: Made XWorkConverter able to convert BigDecimal and BigInteger by passing through to the DefaultTypeConverter from Ognl

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

  • Participants
  • Parent commits 805bc6e

Comments (0)

Files changed (2)

File src/java/xwork-default-conversion.properties

 java.util.Set        =com.opensymphony.xwork.util.XWorkBasicConverter
 java.lang.Class      =com.opensymphony.xwork.util.XWorkBasicConverter
 [Ljava.lang.String;  =com.opensymphony.xwork.util.XWorkBasicConverter
+java.math.BigDecimal =com.opensymphony.xwork.util.XWorkBasicConverter
+java.math.BigInteger =com.opensymphony.xwork.util.XWorkBasicConverter
 

File src/test/com/opensymphony/xwork/util/XWorkConverterTest.java

 import ognl.Ognl;
 import ognl.OgnlException;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
         assertEquals(new Float(123.5), converter.convertValue(context, null, null, null, "123.5", float.class));
         assertEquals(new Boolean(false), converter.convertValue(context, null, null, null, "false", boolean.class));
         assertEquals(new Boolean(true), converter.convertValue(context, null, null, null, "true", boolean.class));
+        assertEquals(new BigDecimal(123.5), converter.convertValue(context, null, null, null, "123.5", BigDecimal.class));
+        assertEquals(new BigInteger("123"), converter.convertValue(context, null, null, null, "123", BigInteger.class));
     }
 
     protected void setUp() throws Exception {