I am able to get copyProperties to work with BeanUtils and PropertyUtils
using version 1.5 of commons beanutils.

1. i am using DynaValidatorForm. 
2. i have a BeanInfoClass for my bean providing the PropertyDescriptors.

 try replacing the commons-beanutils.jar with the latest version(1.5) of
commons beanutils.

 i have one more issue, has anybody succesfully combined Validator
Framework, Dynamic Forms and LookupDispatchAction .

I am using DynaValidatorForm, but my form us not validated even if have
validate="true" in my action mapping.

validation of DynaValidatorForm worked fine before using
LookupDispatchAction.

-rana.



-----Original Message-----
From: Brian Topping [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 8:16 PM
To: [EMAIL PROTECTED]
Subject: Re: PropertyUtils.copyProperties() usage in 1.1-b2


> 
> 
> 
> On Fri, 15 Nov 2002, Brian Topping wrote:
> 
> > Date: Fri, 15 Nov 2002 12:10:53 -0800 (PST)
> > From: Brian Topping <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: PropertyUtils.copyProperties() usage in 1.1-b2
> >
> > Hi all, happy friday (again... :)
> >
> > I'm trying to figure out what I am doing wrong with
> > PropertyUtils.copyProperties().  From within my Action, I have:
> >
> >     User user = <bean>;
> >     DynaActionForm regForm = (DynaActionForm) form;
> >     PropertyUtils.copyProperties(regForm, user);
> >
> > When I look at what copyProperties is doing, it's getting a
> > PropertyDescriptor array from getPropertyDescriptors() with the user
> > bean correctly, then it iteratively tries to see if the regForm has any
> > of the properties found in the user bean.  But calling
> > getPropertyDescriptor(regForm, <fieldname>) seems to be comparing the
> > (correct) field names from the bean against the *structure* of the
> > DynaActionForm component (i.e. the multipartRequestHandler, dynaClass,
> > servlet, etc), instead of the DynaFields that I set up in my
> > <form-bean/>.
> >
> 
> Which CVS version number of PropertyUtils are you looking at (second line
> of the sources?  The version I'm looking at, 1.32 (i.e. the current
> nightly builds), does not call getPropertyDescriptors() on a DynaBean.

I was using 1.30, but the code I was looking at seems to be the same on
both 1.32 and 1.30.

> > I don't think nested properties are the answer, and copyProperties() is
> > supposed to work with DynaBean in the source, destination, both or
> > neither.
> >
> > Any ideas?  The code seems to work fine when the source and destination
> > are reversed.  I'm using 1.1-b2.
> >
> 
> Please try a recent nightly build.  Besides bugfixes in Struts, there have
> been bugfixes in the Commons packages as well.

Yes, trying that now, no luck.  I guess it sounds like a local issue,
since you probably would have recognized if I had been doing something
silly :)

I'll keep looking, it just doesn't seem to be doing an instanceof on the
dest bean anywhere in the call chain to see if it should treat the
DynaBean differently.

> 
> > Thanks a bunch,
> >
> > Brian
> 
> Craig

thanks again,

-b

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

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

Reply via email to