I'm not sure what you mean by "I am validating the DynaValidatorForm
properties to check is the user is entering the right value, ...,
which is wrong" but I'm gonna try responding anyway and see if I
interpreted you correctly.

The validation happens after Struts has populated the form bean but
before the Action is called.  The idea is that the action will never
be called unless you agree that the form's contents are valid and that
your action object can handle it.

What this means in the context of BeanUtils.copyProperties() is that
the String value held by the form property is a value that can be
properly converted into a Double (in this case).  So Validator well
say "0.0" is valid, "120.00" is valid, "1a3" is invalid (cannot be
converted to a double).

hth,
Hubert


On 3/24/06, fea jabi <[EMAIL PROTECTED]> wrote:
> BeanUtils.copyProperties(myBusinessBean,form)) is copying DynaValidatorForm
> String values to the myBusinessBean which is having the right data types.
>
> But in validator.xml, I am validating the DynaValidatorForm properties to
> check if user is entering the right value i.e Double. which is wrong.
>
> I think I am missing something here.
>
> Please, explain. thanks.
>
>
>
> >From: "Hubert Rabago" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> >To: "Struts Users Mailing List" <user@struts.apache.org>
> >Subject: Re: formbean of double type value chages when submitting the form
> >Date: Fri, 24 Mar 2006 08:49:50 -0600
> >
> >On 3/24/06, fea jabi <[EMAIL PROTECTED]> wrote:
> > > thankyou for your response and clear expaination.
> > >
> > > If I use String for the formbean do I have to convert it to Double
> >before i
> > > validate?
> > >
> > > Is there an easier way to convert all form-properties in the form at the
> > > same time?
> >
> >Yes.  BeanUtils.copyProperties().
> >
> >Hubert
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to