Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
That's because you don't know for how many hours i've been sitting in from of my computer and screamming at it, haha!!! --- Bryce Fischer <[EMAIL PROTECTED]> escreveu: > Then you are doing better than I did. It took me > several iterations to > figure it out. I ended up testing with two differ

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bryce Fischer
Then you are doing better than I did. It took me several iterations to figure it out. I ended up testing with two differnt forms, putting breakpoints in my Converters to figure out what was going on... Leandro Melo wrote: I almost understand it in the other way, haha... Now things are clear!!! -

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
I almost understand it in the other way, haha... Now things are clear!!! --- Bryce Fischer <[EMAIL PROTECTED]> escreveu: > Leandro Melo wrote: > > >I got one doubt in your code when used in a > situation > >that i mentioned (transforming data from action > form > >to dto). > >When date comes

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bryce Fischer
Leandro Melo wrote: I got one doubt in your code when used in a situation that i mentioned (transforming data from action form to dto). When date comes from action form, they usually come in Strings, but in your method you verify value instanceof Date... This will never happen, as the value comes

RE: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
PROTECTED]> escreveu: > --- Jim Barrows <[EMAIL PROTECTED]> escreveu: > > > > > > > -Original Message- > > > From: Leandro Melo > > [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, September 08, 2004 4:28 PM > > > T

RE: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
--- Jim Barrows <[EMAIL PROTECTED]> escreveu: > > > > -Original Message- > > From: Leandro Melo > [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, September 08, 2004 4:28 PM > > To: Struts Users Mailing List > > Subject: Re: Acti

RE: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Jim Barrows
> -Original Message- > From: Leandro Melo [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 08, 2004 4:28 PM > To: Struts Users Mailing List > Subject: Re: ActionForm data type X BeanUtils -> using Dates > > > I got one doubt in your code when u

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
I got one doubt in your code when used in a situation that i mentioned (transforming data from action form to dto). When date comes from action form, they usually come in Strings, but in your method you verify value instanceof Date... This will never happen, as the value comes in String. Am i s

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bryce Fischer
The custom converter is done independently of the action, form or DTO. First step is to implement the interface org.apache.commons.beanutils.Converter. Keep in mind that the converter you are writing uses the appropriate converter for the original class. So, if you were converting from a String

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bill Siggelkow
http://jakarta.apache.org/commons/beanutils/api/index.html Leandro Melo wrote: I also would like to see this "converter" code and how to use it!!! --- Jason King <[EMAIL PROTECTED]> escreveu: Could you point us at some code that does this? Do you customize in the action, the form or the DTO? B

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bill Siggelkow
Kind of being picky here, but I wouldn't switch the property name like that -- instead; since the form field would be a String I would use String getPaymentDateString() {...} in the ActionForm and Date getPaymentDate() {...} in the domain object. Desai, Sunny wrote: BeanUtils.copyProperties() met

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Leandro Melo
I also would like to see this "converter" code and how to use it!!! --- Jason King <[EMAIL PROTECTED]> escreveu: > Could you point us at some code that does this? Do > you customize in the > action, the form or the DTO? > Bryce Fischer wrote: > > > You can register a different converter that

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Jason King
Could you point us at some code that does this? Do you customize in the action, the form or the DTO? Bryce Fischer wrote: You can register a different converter that BeanUtils uses to copy from a string to a date. Write your own converter, using the date format you need, then use ConvertUtils.

Re: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Bryce Fischer
You can register a different converter that BeanUtils uses to copy from a string to a date. Write your own converter, using the date format you need, then use ConvertUtils.register(...) to register it. That's what I do anyhow. -Original Message- From: Leandro Melo [mailto:[EMAIL PROTECTE

RE: ActionForm data type X BeanUtils -> using Dates

2004-09-08 Thread Desai, Sunny
BeanUtils.copyProperties() method does not work with date fields. One needs to copy it manually using DateFormatter ot something. To avoid garbage getting into date variable in domain object, one should name it other way. For example, if domain object has : Date paymentDate; you should rename the