struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: [S2.2.1] Struts Type Converter for "sub-model" objects not working?
Date Mon, 13 Dec 2010 07:09:22 GMT
2010/12/12 Burton Rhodes <burtonrhodes@gmail.com>:
> I know. I don't have a setIncome(String) method. But I do have
> setIncome(BigDecimal) method , hence the type conversion. Normally the
> class MyCurrencyCoverter will covert the String to BigDecimal, but
> it's never called. I am wondering what I am doing wrong that the
> conversion class is not called.

String to BigDecimal conversion is built-in functionality and looks
like your user is entering $ at the beginning of the field Income
that's why Sturts falling with conversion.

The current converter treats an input string as whole, there is no
parsing to extract numbers, you write your own and assign it to all
BigDecimal types
http://struts.apache.org/2.x/docs/type-conversion.html#TypeConversion-ApplyingaTypeConverterforanapplication


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl

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


Mime
View raw message