See this mail.MAy be this will help you.. http://marc.theaimsgroup.com/?l=struts-user&m=107458904510606&w=2
-----Original Message----- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 5:03 PM To: Struts Users Mailing List Subject: Re: Problems (re)populating nested bean There are two ways of dealing with this (that i know of), as you've seen scope to session or you can use lazy list. Usually complex forms have limited users anyhow so I scope to session. However folks on the list have used lazy list which apparently works although i've never seen it down without two days worth of postings (I guess some folks have time on their hands). For some reason storing forms in sessions isn't a very trendy thing to do. Search the archived for lazy list if this takes your interest, although IMO session is fine and are there to be used. Cheers Mark On 9 Feb 2004, at 16:41, Linus Nikander wrote: > I'm having trouble (re)populating a Form with nested beans when i > submit the > values with the scope set to request. If i run the exact same code > using a > session scope then it works fine. Has anyone run into similar problems > ? If > so, what possible causes of the problem should i be looking at ? > > My actionform contains a list and a string: > > private String action = ""; > private ArrayList problematicOddsList = new ArrayList(); > > > The html code generated html looks like this: > > <form name="UnknownSportForm" method="post" > action="/ManageUnknownSportsAction.do"> > <input type="hidden" name="action" value="update"> > <input type="hidden" name="problematicOddsList[0].siteId" > value="0"> > <input type="hidden" name="problematicOddsList[0].sportType" > value="blahblah"> > > <input type="hidden" name="problematicOddsList[1].siteId" > value="0"> > <input type="hidden" name="problematicOddsList[1].sportType" > value="blahblah2"> > > > > Since the very same code works when I use a session scope I can't quite > figure out what i'm doing wrong. It seems to me that somehow the > instance > that Struts tries to populate using the request contains a List which > is > initialized to too small a size to fit the submitted data, I don't > understand why though and I'm quite sure I've used similar constructs > in the > past without problems (albeit on a Weblogic server and not JBoss). Any > clues > anyone ? > > ---- Actual errormsg form the log ------- > 2004-02-09 16:29:32,218 DEBUG > [org.apache.struts.action.RequestProcessor] > Populating bean properties from this request > 2004-02-09 16:29:32,218 ERROR [org.jboss.web.localhost.Engine] > StandardWrapperValve[action]: Servlet.service() for servlet action > threw > exception > javax.servlet.ServletException: BeanUtils.populate > ... > ... > ... > 2004-02-09 16:29:32,421 ERROR [org.jboss.web.localhost.Engine] ----- > Root > Cause ----- > java.lang.IndexOutOfBoundsException: Index: 4, Size: 0 > ---- Actual errormsg form the log ------- > > > > //Linus Nikander - [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

