struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "horri khalid" <horrikha...@gmail.com>
Subject [BeanUtils]how&where to use ConvertUtils.register
Date Mon, 03 Dec 2007 17:29:40 GMT
Hi everyone,

First excuse me for my english.

So i have the following situation :
   In one hand i have an actionForm (beoForm) with String fields, wich one
of them is  dateOfCreation its type is string. and the other hand i create a
mapping class (beo) has the same fields of actionForm class, but the
dateOfCreation is now the type Date.

i use BeanUtils.copyProperties like this:

             ConvertUtils.register(new DateLocaleConverter(new
Locale("fr"),"dd/MM/yyyy"), Date.class);
             BeanUtils.copyProperties(beo, beoForm);

after executing statements  the dateOfCreation has the null value.

my question  is:
  1- how & where can i use ConvertUtils.register & BeanUtils to convert from
string to date?

any help is apreciated.
-- 
HORRI Khalid
J2EE Developer
---------------------------------------------------------
PHONE: +(212)22897659
GSM    : +(212)77763981

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message