struts1

How to avoid duplicate when a user click the “refresh” button of his browser?


My action is inserting data from form into the database.

Now my problem is every time, user hits "refresh" button of browser, the action class is called with existing data and fresh new entry with the same database is made.

Is there any way to get refresh just refresh the data rather than calling the action class? or at the minimum prevent 'refresh' on the page?


Solution

  • You have to use saveToken() method in action class and reset token values. which is available in Struts