This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes trying to disable back in a struts-based app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "trying to disable back in a struts-based app" Watch "trying to disable back in a struts-based app" New topic
Author

trying to disable back in a struts-based app

Sue Pillai
Ranch Hand

Joined: Nov 04, 2004
Posts: 89
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.


Sue

SCJP 1.2
SCWCD 1.4
SCBCD 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to disable back in a struts-based app