org.apache.wicket.protocol.http
Class WebSession

java.lang.Object
  extended by org.apache.wicket.Session
      extended by org.apache.wicket.protocol.http.WebSession
All Implemented Interfaces:
java.io.Serializable, IEventSink, IClusterable
Direct Known Subclasses:
AbstractAuthenticatedWebSession, HangmanSession, RolesSession

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
WebSession(Request request)
          Constructor.
 
Method Summary
 boolean authenticate(java.lang.String username, java.lang.String password)
          Note: You must subclass WebSession and implement your own.
protected  void cleanupComponentFeedbackMessages()
          Clear all feedback messages
 void cleanupFeedbackMessages()
          Cleans up all rendered feedback messages and any unrendered, dangling feedback messages there may be left after that.
static WebSession get()
           
 WebClientInfo getClientInfo()
          Gets the client info object for this session.
 void invalidate()
          Call signOut() and remove the logon data from whereever they have been persisted (e.g.
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 extend BrowserInfoPage and provide your own markup file
 
Methods inherited from class org.apache.wicket.Session
bind, clear, debug, detach, dirty, error, exists, fatal, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getClassResolver, getFeedbackMessages, getId, getLocale, getMetaData, getPageFactory, getPageManager, getSessionStore, getSizeInBytes, getStyle, info, internalDetach, invalidateNow, isCurrentRequestValid, isSessionInvalidated, isTemporary, nextPageId, nextSequenceValue, onEvent, removeAttribute, replaceSession, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, success, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSession

public WebSession(Request request)
Constructor. Note that RequestCycle is not available until this constructor returns.

Parameters:
request - The current request
Method Detail

get

public static WebSession get()

cleanupFeedbackMessages

public void cleanupFeedbackMessages()
Description copied from class: Session
Cleans up all rendered feedback messages and any unrendered, dangling feedback messages there may be left after that.

Specified by:
cleanupFeedbackMessages in class Session
See Also:
Session.cleanupFeedbackMessages()

cleanupComponentFeedbackMessages

protected void cleanupComponentFeedbackMessages()
Clear all feedback messages


invalidate

public void invalidate()
Call signOut() and remove the logon data from whereever they have been persisted (e.g. Cookies)

Overrides:
invalidate in class Session
See Also:
Session.invalidate()

authenticate

public boolean authenticate(java.lang.String username,
                            java.lang.String password)
Note: You must subclass WebSession and implement your own. We didn't want to make it abstract to force every application to implement it. Instead we throw an exception.

Parameters:
username - The username
password - The password
Returns:
True if the user was authenticated successfully

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 Session constructor because the temporary page needs a constructed Session to be able to work.

If you need to set a default client info property then better use Session.setClientInfo(org.apache.wicket.request.ClientInfo) directly.

Specified by:
getClientInfo in class Session
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 extend BrowserInfoPage and provide your own markup file

Returns:
the WebPage which should be used while gathering browser info


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.