de.hs_rm.cs.lecturenotes.server.core.transport
Class SessionManagerUtil

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.server.core.transport.SessionManagerUtil

public final class SessionManagerUtil
extends java.lang.Object

Utility class for session handling. Contains commonly used methods around the HttpSession object.

Version:
$LastChangedRevision: 265 $
Author:
Enrico Homann

Field Summary
static java.lang.String SESSION_ATTRIBUTE_KEY_USER
          Attribute name for 'user' that stores the User object of the session maintained by the individual HttpSession object.
 
Method Summary
static javax.servlet.http.HttpSession getHttpSession(javax.servlet.http.HttpServletRequest req)
          Will return the HttpSession from the HttpServletRequest req.
static User getUserFromCurrentSession(javax.servlet.http.HttpSession session)
          Separates the User object from the HttpSession object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_ATTRIBUTE_KEY_USER

public static final java.lang.String SESSION_ATTRIBUTE_KEY_USER
Attribute name for 'user' that stores the User object of the session maintained by the individual HttpSession object. The value for this attribute is set in the Login process and then used by methods that need to check for the validity of the login.

See Also:
Constant Field Values
Method Detail

getUserFromCurrentSession

public static User getUserFromCurrentSession(javax.servlet.http.HttpSession session)
Separates the User object from the HttpSession object.

Parameters:
session - HttpSession
Returns:
User embedded in the HttpSession

getHttpSession

public static javax.servlet.http.HttpSession getHttpSession(javax.servlet.http.HttpServletRequest req)
Will return the HttpSession from the HttpServletRequest req.

Parameters:
req - HttpServletRequest
Returns:
HttpSession