On Wed, 5 Feb 2003, Wendy Smoak wrote:
> Date: Wed, 05 Feb 2003 10:47:53 -0700 > From: Wendy Smoak <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: Converting to DynaValidatorForm > > > I used to use this code (probably lifted from struts-example) to populate my > form bean from a data transport object: > > BeanUtils.copyProperties( form, contact ); > > but now the form is a DynaValidatorForm. I'm looking in the Commons > BeanUtils project, and I was hoping for 'DynaBeanUtils' but I don't see it. > Is there a bit of magic that will call the getters on my DTO (bean) and then > call the set(name,value) method on the DynaValidatorForm? > The magic is there inside copyProperties() already :-). It and nearly every other BeanUtils and PropertyUtils method already does the right thing when you use either a DynaBean or a standard JavaBean. So, you should be able to switch your from bean to DynaValidatorForm and not have to modify the above statement. > Thanks, > > -- > Wendy Smoak Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]