struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: PropertyUtils.copyProperties() usage in 1.1-b2
Date Fri, 15 Nov 2002 21:26:49 GMT

On Fri, 15 Nov 2002, Brian Topping wrote:

> Date: Fri, 15 Nov 2002 12:10:53 -0800 (PST)
> From: Brian Topping <>
> Reply-To: Struts Users Mailing List <>
> To:
> 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 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.

> Thanks a bunch,
> Brian


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message