Thanks! On Wed, Mar 5, 2008 at 2:08 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- Cheng Wei Lee <[EMAIL PROTECTED]> wrote: > > What I was thinking of doing, is to prefix the components at the JSP > such > > that I can pick them up at action classes by iterating. Suppose I've 5 > > textfields that makes up a Person object, and the user dynamically adds > 5 > > Persons at the JSP and submits, what I would do at my action class is to > > loop through, and create a Person object through each set of 5 > textfields. > > > > What do you think of my approach? Or there's a better or more elegant > way > > of doing things? > > Type conversion [1]. > > Nutshell version-- > > Form: > people[0].name, people[0].email... > people[1].name, people[1].email... > > Action: > List<Person> _people; > > The framework does the conversion for you. > > Dave > > [1] http://struts.apache.org/2.x/docs/type-conversion.html > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >