Class BrowserTabInterceptor2

All Implemented Interfaces:
ConditionalInterceptor, Interceptor, Serializable, ConditionalInterceptor, Interceptor

public class BrowserTabInterceptor2 extends AbstractInterceptor
If the action implements BrowserTabAware, sets tab id from cookies. The requesting web page must be set up for this to be correct. See ServletLibrary#getBrowserTabId. This differs from BrowserTabInterceptor by detecting a user has opened a link in a new tab and copying data from the old tab so the user can treat them as independent. See Struts 2 - Server State per Browser Tab, Injected Per-tab Session for more details of how this works.

Interceptor parameters

disabled
If true, all processing is disabled. Defaults to false.

Extending the interceptor

The following methods can be overridden :-

attributeCloneAction
Whether to ignore, copy or clone a tab-specific attribute of the old tab.
attributeFromOldTabToNewClone
Clones a private, tab-specific attribute from the old tab to the new.
attributeFromOldTabToNewCopyConstructor
Copies a private, tab-specific attribute from the old tab to the new using the copy constructor.
attributeFromOldTabToNewCopyReference
Copies reference to a private, tab-specific attribute from the old tab to the new.
attributeFromOldTabToNewIgnore
Notification that a private, tab-specific attribute found in the old tab will not be copied.
attributeFromOldTabToNewNull
Copies null value of a private, tab-specific attribute from the old tab to the new.
attributesFromOldTabToNewTab
Copies private, tab-specific attributes from the old tab to the new by various means.

Example code

 @InterceptorRefs({
   @InterceptorRef(value="browserTab2"),
   @InterceptorRef(value="defaultStack")
})
 
See Also: