Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to disable back in a struts-based app

 
Sue Pillai
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This could be a javascript post, but I thought it better to post it here since I am guessing it is more of a struts-related issue. I am trying to disable the back button, by repainting the current page when a user clicks back. This, I am doing, using the infamous "window.history.forward(1)" While it works well and serves the purpose in most parts of my app, there are some places where it does not do the trick.

I have a search page, where I enter some search criteria and click submit. This calls a struts action class and the search results are then being painted on a jsp. It is this search results page that I am unable to repaint. Meaning if I click back button on this page I am getting a "page cannot be found (server/dns error)"

At this point what is interesting is that if I press enter at the address bar or refresh, I am able to see the page again and clicking a back there on works as expected. It is when I first come onto the search results page that my back click fails.

Has anybody come across such a problem. Right now, since the app is in the stage of completion, I do not have a choice to redesign the entire app (like synchronizer token pattern, etc..) Also for all those against disabling the back button...I have no choice there either...my client wants it and I need to give it.

I greatly appreciate any thoughts and suggestions for my problem. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic