This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Preventing page refresh in jsp pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Preventing page refresh in jsp pages" Watch "Preventing page refresh in jsp pages" New topic
Author

Preventing page refresh in jsp pages

Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79
Hi All,

I generated a web application using jsp related to online shopping. After submitting a record addition, if I press refresh button, again it adds the same information as another record to the database. Is there any clear way to prevent page refresh in jsp pages?

Regards,
Ramesh Kangamuthu
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can't prevent page refreshes but the post-redirect-get pattern will eliminate them from causing a double post in your app.

Look in our JSP FAQ.
There is an entry on the subject in there.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Don't get me started about those stupid light bulbs.
 
subject: Preventing page refresh in jsp pages
 
Similar Threads
Disable Refresh Button of IE ??
Refresh a jsp page
refresh while reading a file...
REFRESH A JSP PAGE
how to display records of mysql database in multiple web pages (page1,page2..) using jsp