Hi,
I am looking to solve the same issue but have no clean solution yet, 
just a few ideas :

Populating dates requires to dynamically obtain date pattern format 
together with the String date value in order to do the String to Date / 
Date to String conversion.

To achieve these goals :

Requirements

1. A validation mechanism is necessary to make sure the right String 
format has been submitted.
2. A conversion mechanism must be implemented.


Solutions

Point 1. Struts Validator http://home.earthlink.net/~dwinterfeldt/  
looks like the answer, with i18n support which is most important for dates.
Point 2. I have come to think of extending or modifying 
org.apache.commons.beanutils.ConvertUtils class source which does the 
actual type conversion.


Any comments, ideas or other solutions are welcome.

Regards, Patrick




[EMAIL PROTECTED] wrote:

>Is there any way to have Beanutils.populate call a setter method with a date
>signature on a bean?
>
>I'm trying to populate a bean with *lots* of properties, some of which are
>dates stored in string format. My source bean has dates in date objects.
>
>Target bean fields/methods:
>
>       String endDate = null;
>
>       public String getEndDate()..
>
>       public void setEndDate(String endDate)
>
>       public void setEndDate(Date d_endDate)
>
>
>Source bean fields/methods:
>
>       Date endDate = null;
>
>       public Date getEndDate()..
>
>       public void setEndDate(Date endDate)
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to