Here's one thing I do to avoid resubmitting. I put a flag on the user's session to tell whether or not he already has done the transaction : On preparing the form put the flag to "true". When submitting, verify that the flag is at true, if so then do the update in the database and put the flag to false. The form won't be submitted again unless the user decides to go to the form page again. For the flag name I usually use the Action instance name, so when i'm in the Action class I do session.setAttribute(this, "true");
Raphaël ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 17, 2003 9:31 AM Subject: RE: ArrayIndexOutOfBoundsException after resubmitting form > May be in the reset you have emptied the list.. > > Have a look at ListUtils.lazyList..That may solve your problem... > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 16, 2003 5:57 PM > To: [EMAIL PROTECTED] > Subject: ArrayIndexOutOfBoundsException after resubmitting form > > > Hi all, > > I've searched the archive, but haven't found an occurrence of the exact > same problem I am encountering. > > Here is a description of the problem: > > My intention is to use transactional tokens to prevent duplicate posting of > a form where a user deletes a row in a list of search results. After the > delete is successful, I use the browser's back button to return to the list > of search results and attempt to submit the request to delete the same row > again. At this point, an ArrayIndexOutOfBoundsException is thrown (the > exception stack trace is provided below). After examining the debug log > statements, it appears that the logic to validate the transactional token > in the action has not yet been reached. The debug log statements indicate > that the form's reset method is invoked and the getter for the list is > called, but that is where it fails. The Struts logic is attempting to go > past the last valid index in the list and I have not found a way to catch > this nor prevent it. > > If anyone has any ideas, it would be much appreciated. > > Thanks in advance, > > Christina > > > > > Here is the Exception Stack Trace: > >>>>> com.ibm.servlet.engine.webapp.WebAppErrorReport > com.ibm.servlet.engine.webapp.WebAppErrorReport: BeanUtils.populate > at com.ibm.servlet.engine.webapp.WebApp.sendError(WebApp.java:597) > at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:188) > at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker. java:239) > at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn vocation.java:67) > at > com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl eInvocationContext.java:106) > at > com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ estProcessor.java:154) > at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener .java:315) > at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.ja va:60) > at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323) > at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252) > at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137) > >>>>> javax.servlet.ServletException > javax.servlet.ServletException: BeanUtils.populate > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) > at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:821) > at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) > at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) > at ca.toyota.core.controller.ControllerServlet.process(ControllerServlet.java:6 00) > at org.apache.struts.action.ActionServlet.$BIP$doPost(ActionServlet.java:525) > at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager .java:827) > at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl eServlet.java:167) > at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle t.java:297) > at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle Servlet.java:110) > at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:47 2) > at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan ager.java:1012) > at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag er.java:913) > at > com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W ebAppRequestDispatcher.java:678) > at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest Dispatcher.java:331) > at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD ispatcher.java:117) > at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) > at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker. java:239) > at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn vocation.java:67) > at > com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl eInvocationContext.java:106) > at > com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ estProcessor.java:154) > at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener .java:315) > at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.ja va:60) > at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323) > at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252) > at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137) > >>>>> java.lang.ArrayIndexOutOfBoundsException > java.lang.ArrayIndexOutOfBoundsException > at java.lang.reflect.Array.get(Native Method) > at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils. java:525) > at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils. java:428) > at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j ava:770) > at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80 1) > at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) > at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) > at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:821) > at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) > at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) > at ca.toyota.core.controller.ControllerServlet.process(ControllerServlet.java:6 00) > at org.apache.struts.action.ActionServlet.$BIP$doPost(ActionServlet.java:525) > at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager .java:827) > at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl eServlet.java:167) > at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle t.java:297) > at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle Servlet.java:110) > at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:47 2) > at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan ager.java:1012) > at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag er.java:913) > at > com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W ebAppRequestDispatcher.java:678) > at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest Dispatcher.java:331) > at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD ispatcher.java:117) > at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) > at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker. java:239) > at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn vocation.java:67) > at > com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl eInvocationContext.java:106) > at > com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ estProcessor.java:154) > at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener .java:315) > at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.ja va:60) > at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323) > at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252) > at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137) > > > > > > > > --------------------------------------------------------------------- > 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]