Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trap Refresh and Back action by user

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !

I need to trap Refresh and Back action by the user in JSP.

Someone suggested me to used token mechanism where you will maintain a token in Session and in hidden field and then compare both to verify the proper flow of the navigation.

Can anybody give me more inside in this?

It would be very helpful if you give some logic for the same.

Reg,
Chetan
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any updates???
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be more specific about what exactly you're trying to do.

While it is impossible for javascript on the client side to know that the page is being refreshed/backed up (as opposed to just closed for example), you can keep track in the session of whether the user has already loaded that page before. Unfortunately that will not tell you if the page is being refreshed/backed, or if the user simply typed the url in or used a bookmark unless there are some query parameters involved.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic