• 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

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

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic