Multiple-page support architecture

When you enable the JViews page identifier feature, JViews can track every page request, linking it with the submitting web page for the duration of the application session. To enable the page identifier feature, see Designing web applications for multiple browser pages.
The following figure shows two pages (Page<A> and Page<B>) that share the same session object and bean. All contextual data is page-dependent and is stored separately:
Page
A and B are open in the same session object. The session bean saves
the state for both pages using page identifiers.
Although conceptual requirements for multiple-page support are relatively simple (contextual data must be stored separately), the application server is not able to identify different browser pages merely by inspecting HTTP request headers, because web browsers do not uniquely identify their tabs and windows. Without any browser-specific cues, the web application must implement a technique to track the pages and store the contextual data accordingly.
JViews implements a technique that combines its custom JSF components, JavaScript library, and image servlets to create and maintain an internal identifier for every web page, independent of the originating browser. The identifier is sent to the browser when its associated page is first loaded, and then transmitted back to the server in the form of a request parameter.
The following figure illustrates how the page identifier (Page-Id) is sent to the browser along with the server response to the first request:
The
first web request creates a page ID. The server sends a response to
the browser, with the page styling, page ID, any JavaScript, and the
document object model.
Once in the web page (Page<B> in the figure), the page identifier (Page-Id) is sent back to the server as a parameter of every request, allowing the server to properly identify the page from which the request is coming. The page identifier is used by the server to retrieve the contextual data from the session or other storage area.
The following figure illustrates how the page identifier (Page-Id) is sent to the server along with other request parameters:
With
the second web request from the same browser page, all parameters
in the request are tagged with the page ID that the server uses to
retrieve contextual data.
The session expires only when the browser is no longer active.