OK, that makes sense. I suppose that since the form has no way of knowing what the contents of the Vector should be, I'll have to use session scope. If the list becomes quite large, would it be wise to remove the list from the session at the earliest opportunity to free up memory?
> -----Original Message----- > From: Gemes Tibor [mailto:[EMAIL PROTECTED] > Sent: 11 June 2003 13:31 > To: Struts Users Mailing List > Subject: Re: Scope related Vector iteration problem > > > James Watkins írta: > > >My problem comes when I try to submit the form. I get the following > >exception when the bean gets populated: > > > >java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 4 > > at java.util.Vector.get(Vector.java:699) > > > >The index is that of the first project with a checked box. > I don't get this > >problem if I put the bean in session scope, but I'd rather > not do that if I > >can avoid it. > > > > > The struts framework only calls the setters, but the setters requires > the object to be present on which they are called. > If the subbeans arent created at construction time, they will > be null, > so NPE is thrown runtime. > > You have 2 alternatives: store in session or construct all > subbeans with > the form. > > Hth, > > Tib > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > DISCLAIMER: This message contains confidential information and is intended for To: and Cc: (name). If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. The content of this e-mail does not necessarily represent the company, its policies, or views, or those of its subsidiaries. If verification is required please request a hard-copy version. Please note that M2 Limited monitors incoming and outgoing mail for compliance with its email policy. This includes scanning incoming emails to detect Viruses.

