struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Lamuette" <>
Subject BeanUtils converting errors
Date Fri, 24 Jan 2003 18:15:51 GMT
BeanUtils v1.6
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 ?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message