You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vijay K Anand <r1...@freescale.com> on 2005/07/07 15:23:23 UTC

Getter/Setter

hi All

Any idea how to write setter / getter methods for multiple form elements ?

Regards
Vijay



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Getter/Setter

Posted by Michael Taylor <mt...@txesystems.com>.
If you mean writing a single method that handles multiple elements, then 
the way to handle this is with DynaBeans.  Struts uses BeanUtils to 
populate the forms, and the DynaBean interface provides support for a 
set of generic set/get methods that can handle normal, indexed, and 
mapped properties.  Thus, you can build a bean backed by a map, a result 
set, etc.  To make this work for a form see DynaForm and override some 
of the get/set methods, or use it as an example and make your own variant.

Cheers,

Mike

------------------------------------------------------------------------
Michael Taylor
TXE Systems, Inc.
mtaylor@txesystems.com


Vijay K Anand wrote:

> hi All
>
> Any idea how to write setter / getter methods for multiple form 
> elements ?
>
> Regards
> Vijay
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>