Hi, What are the standard ways to prevent a user from navigating with the *back* or *forward* of his browser. Is theer a special tip to prevent the *CTRL-N* too. TIA [ March 08, 2002: Message edited by: Bill Bailey ]
/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
I couldn't find the thread I was looking for, but if you search the JSP and Servlet forums, there are several threads refering to the MVC architecture. It will also help your searches if you know that 'MVC' (or Model-View-Controller) is a concept stolen from the SmallTalk language. It is often refered to as the 'Model 2' architecture in web apps. Also of use will be the article on Struts written by our own Thomas Paul in the March version of the JaraRanch Newsletter. (note that Struts helps code the MVC pattern, as opposed to 'being' the MVC pattern) DOM
Joined: Nov 12, 2001
With the MVC pattern there is a variant (sometimes called 'Front' or 'Global' Controllers) where all requests, regardless of what the client is asking for or who the client is, get made to the same Servlet. This servlet decides which page gets sent to the client. There are a few options, but basically you decide on a flow of pages and make sure they get Page2 after they see (and complete) Page1. In this scenario, if they use the back button and it results in the page being re-requested (by disabling caching etc), they think they are going from Page2 back to Page1, except that the Front Controller decides to send them Page2 again, since that is where they are supposed to be in the web app. Therefore the forward and back buttons haven't been disabled or taken over, but they aren't any use to the client. Opening a new window (as long as it shares the same session) works the same. The client can now have 2 windows showing the same page, and it is not recommended since it may be possible to 'corrupt' the data on the server, but they still can't get to a page they aren't supposed to. Dave
Joined: Nov 12, 2001
What I understand is : 1- I have to disable caching in all my jsp pages 2- So each back/forward , refresh and CTRL-N will actually requests the server 3- then my front controller can handle the request
Sounds like you are on your way. You will find it easier in the long run if you use Struts (and have a look at the article by Thomas Paul). Make sure you design the transitions from state to state in a stable manner, since its very easy to get wrong. (and don't use frames, then you'd be maintaining the state across multiple pages...) Dave.