Struts, Data Resubmitting when Refresh button clicked

"Jarrett Grantham" <[email protected]> Fri, 13 Sep 2002 14:25:52 -0500
Newsgroups gmane.comp.web.mvc.devel
Message-ID <[email protected]>
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