You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Brian Alexander Lee <br...@hotmail.com> on 2003/02/06 05:33:45 UTC

[PATCH] Add BigDecimal/Integer converters with default values to initOther() when (convertNull)

Index: ActionServlet.java
===================================================================
RCS file:
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/action/ActionServ
let.java,v
retrieving revision 1.142
diff -u -r1.142 ActionServlet.java
--- ActionServlet.java 28 Jan 2003 19:30:23 -0000 1.142
+++ ActionServlet.java 6 Feb 2003 04:18:49 -0000
@@ -65,6 +65,8 @@

 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigDecimal
+import java.math.BigInteger;
 import java.net.URL;
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -82,6 +84,8 @@
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.beanutils.converters.BigDecimalConverter;
+import org.apache.commons.beanutils.converters.BigIntegerConverter;
 import org.apache.commons.beanutils.converters.BooleanConverter;
 import org.apache.commons.beanutils.converters.ByteConverter;
 import org.apache.commons.beanutils.converters.CharacterConverter;
@@ -1324,6 +1328,8 @@
             ConvertUtils.register(new IntegerConverter(null),
Integer.class);
             ConvertUtils.register(new LongConverter(null), Long.class);
             ConvertUtils.register(new ShortConverter(null), Short.class);
+            ConvertUtils.register(new BigDecimalConverter(null),
BigDecimal.class);
+            ConvertUtils.register(new BigIntegerConverter(null),
BigInteger.class);
         }

     }

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org