This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets ... Intresting One.......

 
ninad parkhi
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having servlet as User Interface(say servlet1) which accepts few inputs from user.After user presses SUBMIT button new Servlet is loaded on the same page (say servlet2).
Now if user presses BACK button of browser he/she goes back to servlet1 and can view the information he/she has entered.
I want that user should not able to view this information(which was previously entered)
Pl reply immediately.............
Thanx
 
Happy Singh
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search for this in HTML and Javascript forum..
AND PLZ DON'T POST 2 posts with the same question, that too during the same time period.
good luck :-)
 
Maky Chopra
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ninad,
You seem to think that a servlet is a magic pill to solve all your programming problem. There is a saying in the software world, that if the only tool you have is a hammer, all the problems begin to look like nails.
In the future, before posting here, please bear in mind that a servlet executes on a server and generates dynamic html to send to a browser.
To answer your questions (which has nothing to do with servlets),in older browsers you could use Javascript to delete the browser history, but as this became a security issue - JS cant touch the history except for navigation (history.go(3), history.go(-3)etc) now in the newer versions.
However, the closest workaround I can think of is to spawn new browser windows with each submit....the NEW loading window should be coded to close the old EXIT window..hence you can perpetually not have a back button that is enabled (no history is carried over from window to window).

[This message has been edited by Mak Bhandari (edited May 04, 2001).]
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ninad,
Here's what to do in your Servlet 1. Before you write the form to the client (i.e. the first thing you should do) is the following
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
There's nothing magic about that date - it's just old enough to invalidate the form's cached content in the browser.
Sean
 
ninad parkhi
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sean & Mak
You solved my problem ........

ninad
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an extended version of the same:

I can't take credit for this (assuming it works, I haven't tried it), it was posted a few days ago. Note that the behavior is still Browser dependent so this isn't in any way the 'ultimate fix'.
Dave.
<read that hammer and nails quote above and pretend it's my .sig>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic