|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.core.SessionContext
public class SessionContext
Encapsulates a HttpSession as a context for Mentawai actions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
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.HttpSession session)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public Object getAttribute(String name)
Context
getAttribute in interface Contextname - The name of the attribute.
public void setAttribute(String name,
Object value)
Context
setAttribute in interface Contextname - The name of the attribute.value - The value of the attribute.public void removeAttribute(String name)
Context
removeAttribute in interface Contextname - The name of the attribute.public void reset()
Context
reset in interface 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()
Context
keys in interface Contextpublic boolean hasAttribute(String name)
Context
hasAttribute in interface Contextname - The name of the attribute.
public void clear()
clear in interface Map<String,Object>public boolean isEmpty()
isEmpty in interface Map<String,Object>public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>public Set<Map.Entry<String,Object>> entrySet()
entrySet in interface Map<String,Object>public Object get(Object key)
get in interface Map<String,Object>public Set<String> keySet()
keySet in interface Map<String,Object>
public Object put(String key,
Object value)
put in interface Map<String,Object>public void putAll(Map<? extends String,? extends Object> t)
putAll in interface Map<String,Object>public Object remove(Object key)
remove in interface Map<String,Object>public int size()
size in interface Map<String,Object>public Collection<Object> values()
values in interface Map<String,Object>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||