| Modifier and Type | Class and Description |
|---|---|
class |
SessionContext.Holder<T>
Holds the value because the listener can change it
|
| Constructor and Description |
|---|
SessionContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Calls getSession(true) to get the session from this request and creates a context for that session.
|
SessionContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
Action action) |
SessionContext(javax.servlet.http.HttpSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
Object |
get(Object key) |
Object |
getAttribute(String name)
Gets an attribute value associated with the given name.
|
String |
getId()
Get the session ID, internaly is call
HttpSession.getId() |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the
HttpServletRequest associated with this context. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the
HttpServletResponse associated with this context. |
javax.servlet.http.HttpSession |
getSession()
Returns the HttpSession associated with this context.
|
boolean |
hasAttribute(String name)
Returns true is an attribute exists with this name.
|
boolean |
isEmpty()
The implementation is not efficient as it loops through all
session values to calculate the size.
|
Iterator<String> |
keys()
Return an iterator with all the attribute names in this context.
|
Set<String> |
keySet() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> t) |
Object |
remove(Object key) |
void |
removeAttribute(String name)
Removes an attribute associated with the given name.
|
void |
reset()
Resets this context.
|
void |
setAttribute(String name,
Object value)
Sets an attribute value associated with the given name.
|
int |
size() |
Collection<Object> |
values() |
public SessionContext(javax.servlet.http.HttpSession session)
public SessionContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
req - The request from where to get the session.public SessionContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
Action action)
public Object getAttribute(String name)
ContextgetAttribute in interface Contextname - The name of the attribute.public void setAttribute(String name, Object value)
ContextsetAttribute in interface Contextname - The name of the attribute.value - The value of the attribute.public void removeAttribute(String name)
ContextremoveAttribute in interface Contextname - The name of the attribute.public void reset()
Contextpublic String getId()
HttpSession.getId()public javax.servlet.http.HttpServletRequest getRequest()
HttpServletRequest associated with this context.HttpServletRequest associated with this context.public javax.servlet.http.HttpServletResponse getResponse()
HttpServletResponse associated with this context.HttpServletResponse associated with this context.public javax.servlet.http.HttpSession getSession()
public Iterator<String> keys()
Contextpublic boolean hasAttribute(String name)
ContexthasAttribute in interface Contextname - The name of the attribute.public boolean isEmpty()
public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>Copyright © 2015. All Rights Reserved.