You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Néstor Boscán <ne...@gmail.com> on 2009/02/20 18:39:16 UTC

S2 How to configure converter for double in xwork-conversion

Hi

 

I’m using Struts 2.0.14 and I’ve created a converter for Decimal types and
configure them in xwork-conversion.properties:

 

java.lang.Float = ve.com.tcs.commons.view.converter.DecimalTypeConverter

java.lang.Double = ve.com.tcs.commons.view.converter.DecimalTypeConverter

java.math.BigDecimal =
ve.com.tcs.commons.view.converter.DecimalTypeConverter

 

Now if I have a form that maps to a class with a “double” primitive type
attribute it will use the converter from Action to JSP, but not from JSP to
Action. I created a Class-conversion.properties to see if the problem
persists, and it uses the converter from JSP to Action but it tells the
converter that it’s trying to convert to Double.TYPE. How can I configure
xwork-conversion.properties to use a specific converter for “float” and
“double” primitive types?

 

Regards,

 

Néstor Boscán