|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jfw.web.util.SessionUtils
public final class SessionUtils
Implements methods for manage a session. All methods are static and thread safe.
| Constructor Summary | |
|---|---|
SessionUtils()
|
|
| Method Summary | |
|---|---|
static javax.servlet.http.HttpSession |
create(javax.servlet.http.HttpServletRequest request)
Create a session. |
static javax.servlet.http.HttpSession |
get(javax.servlet.http.HttpServletRequest request)
Get the session. |
static javax.servlet.http.HttpSession |
get(javax.servlet.http.HttpServletRequest request,
boolean create)
Get the session. |
static java.lang.Object |
getAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
Get an attribute from session. |
static java.lang.Object |
getAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key,
java.lang.Object defaultValue)
Get an attribute from session. |
static java.lang.Object |
getAttribute(javax.servlet.http.HttpSession session,
java.lang.String key)
Get an attribute from session. |
static java.lang.Object |
getAttribute(javax.servlet.http.HttpSession session,
java.lang.String key,
java.lang.Object defaultValue)
Get an attribute from session. |
static boolean |
setAttribute(javax.servlet.http.HttpServletRequest request,
boolean create,
java.lang.String key,
java.lang.Object value)
Add and attribute in session. |
static boolean |
setAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key,
java.lang.Object value)
Add and attribute in session. |
static boolean |
setAttribute(javax.servlet.http.HttpSession session,
java.lang.String key,
java.lang.Object value)
Add and attribute in session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionUtils()
| Method Detail |
|---|
public static javax.servlet.http.HttpSession create(javax.servlet.http.HttpServletRequest request)
request - an HttpServletRequest object.
public static javax.servlet.http.HttpSession get(javax.servlet.http.HttpServletRequest request,
boolean create)
request - an HttpServletRequest object.create - if true create the session if not exist,
if false the session will not created.
public static javax.servlet.http.HttpSession get(javax.servlet.http.HttpServletRequest request)
request - an HttpServletRequest object.
public static java.lang.Object getAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
request - an HttpServletRequest object.key - the name of the attribute.
public static java.lang.Object getAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key,
java.lang.Object defaultValue)
request - an HttpServletRequest object.key - the name of the attribute.defaultValue - the default value.
public static java.lang.Object getAttribute(javax.servlet.http.HttpSession session,
java.lang.String key)
session - an HttpSession object.key - the name of the attribute.
public static java.lang.Object getAttribute(javax.servlet.http.HttpSession session,
java.lang.String key,
java.lang.Object defaultValue)
session - an HttpSession object.key - the name of the attribute.defaultValue - the default value.
public static boolean setAttribute(javax.servlet.http.HttpSession session,
java.lang.String key,
java.lang.Object value)
session - an HttpSession object.key - the name of the attribute.value - the valule of the attribute.
public static boolean setAttribute(javax.servlet.http.HttpServletRequest request,
boolean create,
java.lang.String key,
java.lang.Object value)
request - an HttpServletRequest object.create - if true create the session if not exist,
if false the session will not created.key - the name of the attribute.value - the valule of the attribute.
public static boolean setAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String key,
java.lang.Object value)
request - an HttpServletRequest object.key - the name of the attribute.value - the valule of the attribute.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||