> > > > 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:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

