Package org.apache.wicket.protocol.http
Class WebSession
- java.lang.Object
-
- org.apache.wicket.Session
-
- org.apache.wicket.protocol.http.WebSession
-
- All Implemented Interfaces:
java.io.Serializable,IEventSink,IFeedbackContributor,IMetadataContext<java.io.Serializable,Session>,org.apache.wicket.util.io.IClusterable
public class WebSession extends Session
A session subclass for the HTTP protocol.- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.Session
clientInfo, SESSION_ATTRIBUTE_NAME
-
-
Constructor Summary
Constructors Constructor Description WebSession(org.apache.wicket.request.Request request)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgenerateNewSessionId()Change the id of the underlying (Web)Session.static WebSessionget()WebClientInfogetClientInfo()Gets the client info object for this session.voidinvalidate()Call signOut() and remove the logon data from whereever they have been persisted (e.g.protected WebPagenewBrowserInfoPage()Override this method if you want to use a custom page for gathering the client's browser information.
The easiest way is just to extendBrowserInfoPageand provide your own markup file-
Methods inherited from class org.apache.wicket.Session
bind, changeSessionId, clear, debug, detach, dirty, dirty, error, exists, fatal, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getClassResolver, getFeedbackMessages, getId, getLocale, getMetaData, getPageFactory, getPageManager, getSessionStore, getSizeInBytes, getStyle, info, internalDetach, invalidateNow, isSessionInvalidated, isTemporary, newPageAccessSynchronizer, nextPageId, nextSequenceValue, onEvent, onInvalidate, removeAttribute, replaceSession, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, success, warn
-
-
-
-
Constructor Detail
-
WebSession
public WebSession(org.apache.wicket.request.Request request)
Constructor. Note thatRequestCycleis not available until this constructor returns.- Parameters:
request- The current request
-
-
Method Detail
-
get
public static WebSession get()
-
invalidate
public void invalidate()
Call signOut() and remove the logon data from whereever they have been persisted (e.g. Cookies)- Overrides:
invalidatein classSession- See Also:
Session.invalidate()
-
getClientInfo
public WebClientInfo getClientInfo()
Gets the client info object for this session. This method lazily gets the new agent info object for this session. It uses any cached or set (Session.setClientInfo(ClientInfo)) client info object.To gather the client information this implementation redirects temporarily to a special page (
BrowserInfoPage).Note: Do not call this method from your custom
Sessionconstructor because the temporary page needs a constructedSessionto be able to work.If you need to set a default client info property then better use
Session.setClientInfo(org.apache.wicket.core.request.ClientInfo)directly.- Specified by:
getClientInfoin classSession- Returns:
- the client info object based on this request
-
newBrowserInfoPage
protected WebPage newBrowserInfoPage()
Override this method if you want to use a custom page for gathering the client's browser information.
The easiest way is just to extendBrowserInfoPageand provide your own markup file- Returns:
- the
WebPagewhich should be used while gathering browser info
-
generateNewSessionId
protected java.lang.String generateNewSessionId()
Description copied from class:SessionChange the id of the underlying (Web)Session.- Specified by:
generateNewSessionIdin classSession- Returns:
- the new session id value.
-
-