Craig, Rana, thanks for your responses, hoping you guys can provide some input:
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > Subject: Re: PropertyUtils.copyProperties() usage in 1.1-b2 > > > 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. K, here's what I'm seeing under PropertyUtils 1.32: in copyProperties: orig is neither Map nor DynaBean, so line 283 calls getPropertyDescriptors(orig). Then, for each readMethod in the result, line 296 has: String name = origDescriptors[i].getName(); if (getPropertyDescriptor(dest, name) != null) { But getting into getPropertyDescriptor(), line 869 calls getPropertyDescriptors(bean). If the dest is a DynaBean, I'm not seeing where the "instanceof DynaBean" is -- it simply calls Introspector.getBeanInfo().getPropertyDescriptors(), but the result of getBeanInfo doesn't know anything about DynaBeans. What am I missing here? Rana says this is working and appreciate his input, especially with the release notes reference (thanks!) But tracing through the code and triple-checking at the beans (they both have a "name" property), I still can't see how this is going to work, and in practice, the destination DynaBean is untouched. Thanks again, -b -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>