RE: Struts, Data Resubmitting when Refresh butt on clicked
"Deep, Kamal" <[email protected]> Fri, 13 Sep 2002 18:38:42 -0400
| Newsgroups | gmane.comp.web.mvc.devel |
|---|---|
| Message-ID | <[email protected]> |
you may want to use redirect = "true", when you forward your request after saving it. you forward tag should look like <forward name="success" path="/do/userList" redirect="true"/> hope that helps. -Kamal -----Original Message----- From: Jarrett Grantham [mailto:[email protected]] Sent: Friday, September 13, 2002 3:26 PM To: [email protected] Subject: [MVC-Programmers] Struts, Data Resubmitting when Refresh button clicked I have a unique "problem" with struts actions resubmitting data to the backend when a user clicks on the refresh button of their browser after the action has occurred. As a result duplicate records get created on the backend. For example: 1. A action is invoked to save a user name, data, etc- <action path="/saveUser" type="org.SaveUser" name="UserForm" scope="request" validate="false"> <forward name="success" path="/do/userList"/> </action> 2. The new record is saved to the DB. (everything is ok at this point) 3. which forwards to the following action mapping upon success (everything is ok at this point) <action path="/userList" type="org.UserList" name="UserListForm" scope="request" validate="false"> <forward name="success" path="/jsp/main.jsp?content=/jsp/userList.jsp"/> </action> ***Now at this point a list of user's appear (everything has worked so far). If the user clicks the refresh button on their browser, saveUser seems to get executed again and a new user is created(a duplicate). This makes no sense since the last action was userList; however, it seems that saveUser is being executed. Is this a result of my browser cache or something like that? Can anyone explain why the prior action to the action that just occurred is getting executed? Any help/comments are appreciated. Thanks, Jarrett Jarrett Grantham Razza Solutions 1149 Haleys Way Dr Buda, Tx 78610 512-797-8198 www.razzasolutions.com _______________________________________________ MVC-Programmers mailing list [email protected] http://www.netbean.net/mailman/listinfo/mvc-programmers _______________________________________________ MVC-Programmers mailing list [email protected] http://www.netbean.net/mailman/listinfo/mvc-programmers