Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When refreshing the page redirecting the user to my desired page?  RSS feed

 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my MVC based application, when i am displaying some readonly data from my database in a JSP page & when i click on the button i get navigated to some other next page...

When i click on the back button i have set the response headers for no caching.

But when cliking on the back button & then refreshing the page the same page gets displayed with the readonly details previously displayed.But what i want to do is whenever the user refreshes the page i want to make the user redirect to my desired page??

Is it possible??
If yes then how can i do it??
If no then some alternatives to achieve to do this thing??

Thanks,
Jignesh
[ March 29, 2006: Message edited by: Bear Bibeault ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Back Browser Button, Refresh all these will send a NEW request from browser to server. Here you got to understand that Back Browser Button is requesting for previous page where as Refresh is requesting for the same resource.


When i click on the back button i have set the response headers for no caching.


You are still in the same application/session, so the pages will be cached


But when cliking on the back button & then refreshing the page the same page gets displayed with the readonly details previously displayed.


Here you are requesting the same page with the data fetched from database. If you redirect to another resource in this page then you will never look at the data fetched from database.

Do you get the point.
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what can i do to prevent the user from navigating using the back button, as i have to allow the user to do the transaction only once.... otherwise there will be duplicate entries in the database which is not the thing i want??

Thanks,
Jignesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!