Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 25263 invoked from network); 15 Nov 2002 21:27:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 15 Nov 2002 21:27:14 -0000 Received: (qmail 16712 invoked by uid 97); 15 Nov 2002 21:27:57 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 16687 invoked by uid 97); 15 Nov 2002 21:27:57 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 16671 invoked by uid 98); 15 Nov 2002 21:27:56 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Fri, 15 Nov 2002 13:26:49 -0800 (PST) From: "Craig R. McClanahan" To: Struts Users Mailing List Subject: Re: PropertyUtils.copyProperties() usage in 1.1-b2 In-Reply-To: <200211152010.gAFKAr7I020012@spies.com> Message-ID: <20021115132235.V90289-100000@icarus.apache.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: struts-user@jakarta.apache.org > 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 = ; > 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, ) 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 > . > 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 Craig -- To unsubscribe, e-mail: For additional commands, e-mail: