The problem is that Struts tries to populate your form, it starts with an
empty collection.  Take a look at LazyList (search the mailing list
archives), or pre-initialize your form and put it in session scope. 

For more info, read http://struts.apache.org/faqs/indexedprops.html and
http://www.developer.com/java/other/article.php/2233591.

--- Andrew Close <[EMAIL PROTECTED]> wrote:

> hi all,
> 
> i'm having a hard time getting data from multiple textfields with
> similar names out of a form and into my actionform.
> in my JSP i'm using a [logic:iterate] tag to display (up to) ten
> textfields.  these textfields are initially empty.  the user enters
> data into the text fields and hits 'add', and i get an
> IndexOutOfBoundsException.  this exception isn't occuring in my code,
> but i'm sure it's due to something i'm doing (or not doing) in my
> code.
> my action form has a Collection variable named itms that is an
> ArrayList.  the getter returns a Collection and the setter takes an
> array of Strings, iterates through them and puts them into the
> ArrayList.  although i never get to that point.
> i'm sure that my actionform is to blame and whatever Struts does
> behind the scenes to populate my actionform is blowing up.
> 
> i've looked at a couple of Ted Husteds articles (most notably: Use an
> array to capture multiple parameters) but they don't seem to deal with
> getting data out of the page form and into the action form.  i've also
> tried to search the mailing list archives but i keep getting the
> message 'Text search not available for this list'...
> 
> any pointers or suggestions on correctly setting up an actionform to
> retrieve data from textfields that were built with an iterator?
> 
> thanks
> andy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to