• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disable browser back button jsp

 
swzka
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,


Can any one tell how o disable a browser back button using jsp code.


Thanks,
swzka
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
swzka swzka
Welcome to JavaRanch!

We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by swzka swzka:
Can any one tell how o disable a browser back button using jsp code.


You can't. JSP is a server-side technology. It has no control over the browser.
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use JavaScript on yyour client tier.




If you want a server-side solution to prevent duplicate submits then should try and use Session token synchronization pattern.
 
abhishek gowlikar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<script>
history.back(-1);
</script>
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear in mind that one can easily turn off javascript in his browser and can use the back button. So, as ak pillai said

If you want a server-side solution to prevent duplicate submits then should try and use Session token synchronization pattern.
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by swzka swzka:
how o disable a browser back button


As everyone else said, it cannot be done.

Why do you want to disable the back button? There may be a better way of doing what you're trying to accomplish.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Redirect after post might be helpful in this regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!