commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [BeanUtils] Registering converters. Help!!
Date Sat, 25 Jan 2003 20:23:03 GMT
hi Richard

are you registering a converter (IntegerLocaleConverter, say) to perform 
the string-to-integer conversion?

- robert

On Saturday, January 25, 2003, at 02:01 PM, Richard Lamuette wrote:

> BeanUtils v1.6 in Stuts 1.1b3
> When trying to resolve the problem of populating form bean or business 
> bean
> with date types, I use :
>    ConvertUtils.register ( new SqlDateLocaleConverter( Locale.getDefault(
> ),
> "dd/MM/yyyy") , java.sql.Date.class);
>    ConvertUtils.register ( new StringLocaleConverter(
> Locale.getDefault(),"dd/MM/yyyy") , String.class);
>
> eveything works great by using BeansUtil.copyProperties(form,business)
> * in my form bean, String type for my date
> * in my business bean, java.sql.Date type for my date
>
> But the problems appear when I add another property to my form and my
> business bean,
> * in my form bean, String type for my integer
> * in my business bean, Integer type for my integer
>
> BeanUtils copy in the string property of my form bean : 
> dd/MM/yyyyMYINTEGER
> Actually, it uses the same pattern "dd/MM/yyyy" for converting Integer to
> String than for converting Date to String.
> The problem is obviously there in the management of the different sources 
> of
> pattern in the Converters, the pattern is not related to the source type 
> of
> the conversion. Am I right ?
> Thank you for your support.
> Richard.
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-user-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-user-help@jakarta.apache.
> org>
>


Mime
View raw message