This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Browser Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Browser Refresh" Watch "Browser Refresh" New topic

Browser Refresh

Rohit Prasad

Joined: Sep 05, 2006
Posts: 12
How can I detect in my Action when user clicked refresh button from browser?

Thanks for any help.

saivenu madhav

Joined: Nov 15, 2007
Posts: 29
Hello friends,

I have a problem which i am trying to resolve but not able to do so. Any help in this regard would be appreciated.

I have a jsp page (x.jsp) which has an "Add" button. On click of Add button, another popup jsp page (y.jsp) would open that would list the users details like firstname, middlename, lastname, email etc.. I select a record in the popup jsp page and clicks on the OK button. On click of the OK button, the selected record would be placed in the parent jsp page (x.jsp) and the popup jsp page (y.jsp) will close. Now i click the save button on the parent jsp page (x.jsp) which will save the selected user details along with other info on the page.

Now my problem is after successful save, if i click on the refresh button, the recently added user record will again get inserted into the database and now there would be two user records with same info which actually should not happen. Is there any way to avoid database insert on click of the refresh button.

Please help,

Thanks in Advance,

vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Go for savetoken stuff in struts
saivenu madhav

Joined: Nov 15, 2007
Posts: 29
Hi Viday sagar,

I am using single action for inset&Update i.e SaveAction.

Could you please give some code to help the above problem. currenlty i am doing with

But it is not working .

wood burning stoves
subject: Browser Refresh
Similar Threads
Reply Posted doesn't show up.
Upload attachment to QC [Quality Center] using java
Editing HTML page in eclipse
Facing problem
JSP functions