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
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!!!
-
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
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
PROTECTED]>
escreveu:
> --- Jim Barrows <[EMAIL PROTECTED]> escreveu:
> >
> >
> > > -Original Message-
> > > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, September 08, 2004 4:28 PM
> > > T
--- 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
> -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
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
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
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
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
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
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.
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
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
15 matches
Mail list logo