• 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

macking backward button false in browser window

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers !
i have created a login page in jsp and verify this login through a servlet.if login is successfull then it is redirects to another jsp.i have a problem when the new jsp is displayed then if i press the backward button of the browser then it comes on the login page.i want to create the application such that the back button of the browser not work to direct to the login page.i want to make that the back button of the browser is appear as disable.Please help me to make the disable the back button of the browser.
[ April 08, 2007: Message edited by: Bear Bibeault ]
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Amar,
You cannot disable the back button in the user's browser.

You can set the page to "no cache" and display a different page if they choose to refresh it.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Topic Title: "Making backward button false in browser window"
My Question: "Is the button really backward that we need to make it false?"

Just kiddin.

Agreed with Jeanne.
 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers !
is anybody help me to making a page with no cache please give me some code example.it's urgent for me.
thanks
 
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
Two things to read:

First, see:
EaseUp to find out why adding the word "urgent" to your post or subject line can actually slow down or stop responses to your question altogether

Second, Have a look at our JSP Faq:
http://faq.javaranch.com/view?JspFaq
There, you will find a section devoted to showing you how to add no-cache directives to your pages.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you put



at the top of your page, it will attempt to go forward a page in your history. If you go to another page, and then try to click back and go to this page, you will be bounced forward.

As an aside, if you do this, people will hate you. True story.

You probably want to use a servlet Filter to make the user go to the right page after authentication. Or use Acegi and let it do the hard work for you.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Min Huang:
As an aside, if you do this, people will hate you. True story.



Yes, there's nothing like really annoying your user base with browser tricks that don't serve any real purpose to engender loyalty.
 
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

Originally posted by Min Huang:

As an aside, if you do this, people will hate you. True story.




Heh.

I started playing with this idea a while back.
I had read something similar a long time ago but couldn't find a link to it.
I never added a link for this one to any of the FAQ pages because I could never get it to sound "friendly" enough for JavaRanch.

Maybe somebody else can.
http://faq.javaranch.com/view?InterfaceDesignersRule1
 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers ! i want to use this java script function in my jsp page javascript:history.back().how i should use this function so that if any one want to go to back page i can invalidate my session.please give me some code example.so that as the user clicks on the backward button of the browser the session can be expired.Thanks in Advance.
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Amar,

Please visit to this URL

http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html

or

http://www.javaworld.com/javaworld/jw-10-2006/jw-1006-logout.html

I guess this will help you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic