public class IlvFacesPageIdUtil extends Object
This class provides utility methods used to support multiple pages per session (multiple tabs in a browser) in a Faces context.
Because browsers do not uniquely identify tabs, use the methods of
this class to enable JViews JSF to distinguish requests coming from
different tabs in the same browser. This functionality relies on
FacesContext
, and on the creation and retrieval of unique
indentifiers for each tab of a client browser.
Modifier and Type | Method and Description |
---|---|
static String |
getPageId()
Returns the page identifier stored in the current
request attribute.
|
static Object |
getSessionAttributeWithPageId(String name)
Retrieves an object from this session using a page identifier.
|
static String |
setSessionAttributeWithPageId(String name,
Object value)
Stores a given object in this session using a page identifier.
|
public static String getPageId()
Returns the page identifier stored in the current request attribute. If no identifier is found, a new one is created and added to the request.
Implementation is based on a sequential int
counter limited to 2,147,483,647 page identifiers. With this implementation,
there is little risk that repeating identifiers will be assigned to the same
session, even in the unlikely event an application reaches this preset limit.
public static String setSessionAttributeWithPageId(String name, Object value)
Stores a given object in this session using a page identifier.
The page identifier is combined with the provided name
parameter to form a unique identifier that is only known to the page
originating the request. This permits multiple tab support, as the
page in a browser tab does not share this object with the same page
opened in a different tab.
This method:
name
- The original attribute name to be combined with the
page identifier. It cannot be null
.value
- The object being bound to the attribute name.name
parameter with the
page identifier.public static Object getSessionAttributeWithPageId(String name)
Retrieves an object from this session using a page identifier.
This method combines the name
parameter with the page
identifier to form the attribute name used to retrieve the object.
name
- The original attribute name to be combined with the
page identifier. It cannot be null
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.