• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reload the jsp page

 
Shaik Vali
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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.
 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic