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:
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:
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:
The session expires only when the browser is no longer
active.