• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

reload the jsp page

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi , I need to reload the jsp page even I clicks the browser's navigation (back & forward)buttons , please give the solution.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try using this javascript in your page, this will disable Back button
<script language="JavaScript">
<!--
javascript:window.history.forward(1);
//-->
</script>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't disable the back button and this will not solve the original poster's issue.

Look in our JSP FAQ for articles on no-cache headers and the Post-Redirect-Get pattern. The combination of these two things will greatly reduce the likely hood that someone will back into a page with stale data on it.
 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
adding client-side JavaScript code on the page that we do not want to let the user return to, gives effect of hitting the forward button, which would counter any action by a user clicking the back button and user will see same page even after clicking back button.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This technique amounts to a cheap parlor trick and is extremely annoying to the end user. It doesn't work if the user disables Javascript and can easily be defeated with scripts written for the GreaseMonkey plugin for Firefox.

The user's browser is theirs and the developer of a particular app or page has no business tinkering with the way it works. Think of your app as a guest in the user's house. Make sure it can handle back button and refresh button clicks gracefully instead of trying to defeat them.
reply
    Bookmark Topic Watch Topic
  • New Topic