That's not it.  I still get same error.

I thought when the form is submitted, Strut will re-construct the collection
of objects with values from the input form.  Therefore, I don't have to
specify the Collection/List size in the form bean constructor.  


-----Original Message-----
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 25, 2005 12:11 PM
To: 'Struts Users Mailing List'
Subject: RE: Use Indexed properties - Encounter IndexOutOfBound Exception


> I'm trying to use Strut indexed tag but keep getting
> java.lang.IndexOutOfBoundsException: Index: -999999999.  It 
> displays with correct values but when the form is submitted, 
> I got the error.  Below is a snip of my code.  Do you know 
> what's wrong with it?

When you submit your form, the Struts controller finds what form bean is
associated with it and constructs an instance of that form. It then starts
assigning values to it, using the accessor methods. For indexed properties,
it uses an accessor to retrieve a collection of objects, then gets the
object indicated by the index from the collection, then uses an accessor
method in that object to assign a value.

And there's your problem. If your form bean's constructor doesn't create a
collection with enough items in it, the struts controller will try to access
a non-existent member of the collection at this point. 


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





------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

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

Reply via email to