CHAPTER 9 STATE (Web hosting domain names) NAVIGATION PATTERN In the

CHAPTER 9 STATE NAVIGATION PATTERN In the example, the request is an HTTP POSTthat posts to the static file linkToPage2.xml. What is odd is that an HTTP POST has been made to a document that cannot process the post because the file is obviously not a script. This is the uniqueness of the State Navigation pattern in that when data is posted, the result does not have to be another page that is viewed by the web browser. Normally, when executing an HTTP POST, a server-side script will process the request and generate some output. Unlike an HTTP GET, where data is retrieved, the HTTP POST expects data to be sent before it is retrieved. When creating a workflow application, HTML pages are tied to each other. For example, if the resource /ajax/chap07/page1 contains a POSTto /ajax/ chap07/page2, only page1 can call page2, because page2 expects data arriving from page1. Of course, the developer could write within the script of page2 a decision block to test how the script is being called and what it should do. Nevertheless, this makes for messy coding. What is different with the State Navigation pattern is that the sending of the data and retrieving of the next content are separated. The State Navigation posts to a URL that may or may not process the posted content. The State Navigation would capture the request, store the state, and pass the request to another processor on the HTTP server. Another processor would intercept the request, process the state, and let the HTTP server send the data to the client. The state that is sent to the server can be stored or processed and is the discretion of the web server application. The advantage of this approach is that by using the State Navigation pattern, a URL can cumulatively process the state and generate a single transaction. The solution provided by the State Navigation pattern is to use the POST as a mechanism to record and process data. The workflow is created by documents that contain a link to the next resource. This makes it possible to separate the dependency of page2to page1. The result is that the web application allows a reorganization of the HTML content flow, allowing decisions to be made on the fly. Continuing the communications, the server would respond to the HTTP POST with the following answer: HTTP/1.1 200 OK X-Page-State: 11 ETag: W/”137-1126885576359″ Last-Modified: Fri, 16 Sep 2005 15:46:16 GMT Content-Type: application/xml Content-Length: 137 Server: Apache-Coyote/1.1 When the client has loaded the returned data, the script searches for a link that indicates the URL to be loaded by the client. The script then redirects the browser by reassigning location. href, causing the following request to be made by the browser: GET /ajax/chap07/page2 HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-ca Accept-Encoding: gzip, deflate
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

Leave a Reply