Class ServletLibrary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBrowserOldTabId
(javax.servlet.http.Cookie[] cookies) static String
getBrowserTabId
(javax.servlet.http.Cookie[] cookies) Returns tab id within a browser that, when combined with session, uniquely identifies a browser tab, or null if this information is missing.static String
getGuaranteedBrowserTabId
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Returns id that uniquely identifies a browser tab.static javax.servlet.http.Cookie
Returns a new cookie to set the browser's tab id.
-
Field Details
-
OLD_TAB_ID_COOKIE_NAME
- See Also:
-
TAB_ID_COOKIE_NAME
- See Also:
-
SET_TAB_ID_COOKIE_NAME
- See Also:
-
COOKIE_NAME_POPUP_MARKER
- See Also:
-
-
Constructor Details
-
ServletLibrary
public ServletLibrary()
-
-
Method Details
-
getBrowserOldTabId
-
getBrowserTabId
Returns tab id within a browser that, when combined with session, uniquely identifies a browser tab, or null if this information is missing. Web pages making requests must include browserTab2.js for this to work correctly. generateTabId in the same library must have already been called in the tab's lifetime but the script automatically adds this to page loading anyway.
Popup windows can be problematic if displaying session-based data created by other windows, particularly record list caches. If the popup is created by Javascript window.open, set the popup window name to end with the creator's window top name, such as
window.open('', 'historypopup' + window.top.name, 'left=400,top=300')
. Don't forget any hyperlinks that refer to the popup window name as its target.- Parameters:
cookies
- Cookies obtained from HTTP servlet request.
-
getGuaranteedBrowserTabId
public static String getGuaranteedBrowserTabId(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Returns id that uniquely identifies a browser tab. This requires web pages to use browserTab2.js. SeegetBrowserTabId(javax.servlet.http.Cookie[])
. If the browser hasn't set one, creates one and sets the tab id cookie in the response. If the tab id contains '_popup_', it's from a popup window sharing a tab id with a main page and the tab id is extracted from that. -
makeSetTabIdCookie
public static javax.servlet.http.Cookie makeSetTabIdCookie()Returns a new cookie to set the browser's tab id.
-