CHAPTER 9 STATE NAVIGATION PATTERN Figure 9-10. (Web hosting companies)

CHAPTER 9 STATE NAVIGATION PATTERN Figure 9-10. Rearchitecting multiple resources to use a state identifier In Figure 9-10, each of the web browser instances is a URL, with a hash code identified state identifier that is converted into an X-Page-State HTTP header. Each instance of the web browser has an HTTP header that is unique. This is a good thing because now, even though there are two browsers, the resource /resource2 has two separate instances of the associated state. Having the unique state identifiers works, except it exposes another problem: there is no stringing together of the individual HTML pages to build a web application. What we don t know is how the states relate to each other. Visually, we know that the states 11, 12, and 14are a single chain. And visually we know that 11 and 13are another chain. But the server does not know that because the server does not know that state 13is the result of opening a second browser. To finish the solution, the history of the URLs is needed. The web browser has that information because it is required for navigating the Forward and Back buttons. The simple solution would be to access the browser-exposed history object and pass those URLs to the HTTP POST. The problem with the simple solution is that it is not generally viable. Accessing the history object by using a script is a security issue, and unless the client has allowed access, will generate an exception. A more feasible solution is to add an additional HTTP header that uniquely identifies the window used to chain together the HTML pages. Specifically, the property window.name can be assigned and is ideally suited to uniquely identify the individual HTML windows. Figure 9-11 illustrates the final solution.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Leave a Reply