struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject RE: How do I populate a DynaValidatorForm?
Date Thu, 25 Sep 2003 21:27:53 GMT
Barry Volpe wrote:
> With an Action Form we do the following:
> form = new UserForm();
> form.setUserid("5"); 
> What is the equivalent for a DynaValidatorForm?????
> Let's say my DynaValidatorForm is myForm
> Of course this does not work (compiler does not know what myForm
> DynaValidatorForm dynaForm = (DynaValidatorForm)myForm; 
> myForm.setUserid("5");

"DynaActionForms are not a drop-in replacement for ActionForms. If you
need to access ActionForm properties in your Action, you will need to
use the map-style accessor, like myForm.get("name"). If you actively use
the ActionForm object in your Action, then you may want to use
conventional ActionForms instead."

I populate mine largely with BeanUtils.copyProperties(...).  If you need
to address a specific property, you can use the Map contained within the

> DynaValidatorForm dynaForm = (DynaValidatorForm)myForm; 
> myForm.setUserid("5");

2nd line becomes:

Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 

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

View raw message