Just out of curiosity, when you say "All of this is done automatically by the framework" do you mean if you populate from a form? or how do you mean the framework does this automatically?
Cesar ----- Original Message ---- From: Dave Newton <[EMAIL PROTECTED]> To: Struts Users Mailing List <user@struts.apache.org> Sent: Friday, March 14, 2008 10:27:19 AM Subject: Re: Problem assiging elements in to list --- Cesar Arevalo <[EMAIL PROTECTED]> wrote: > by the time you get to the for loop I don't see the list initialized, > unless you are doing this from your jsp I don't think it will work as how > you have it, a better way would be with a normal for like this : > > for (int index = 0; index < someLimit; index++) { > Person person = new Person(); > persons.add(index, person); > _logger.error("Person ::::::::::::::::::::::::::" + > person); > > e.persist(person); > } > > hope this helps. That would create a list of empty Person instances (then persist the last empty Person, but I'm assuming that's a typo). All of this is done automatically by the framework. > From: Vamsi Gmail! <[EMAIL PROTECTED]> > > I have a requirement where I need to assign a Objects to a list. > I tried the example given in showcase there is working (in the site). > But It is not assigning to that list > > I am also attaching code for your reference. > > [code] You never really state how you're expecting the list to be filled: is this from a form with multiple Person form fields, or...? Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]