|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
org.apache.struts2.dispatcher.SessionMap
public class SessionMap
A simple implementation of the Map interface to handle a collection of HTTP session
attributes. The entrySet() method enumerates over all session attributes and creates a Set of entries.
Note, this will occur lazily - only when the entry set is asked for.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected java.util.Set<java.lang.Object> |
entries
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpSession |
session
|
| Constructor Summary | |
|---|---|
SessionMap(javax.servlet.http.HttpServletRequest request)
Creates a new session map given a http servlet request. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all attributes from the session as well as clears entries in this map. |
java.util.Set |
entrySet()
Returns a Set of attributes from the http session. |
java.lang.Object |
get(java.lang.Object key)
Returns the session attribute associated with the given key or null if it doesn't exist. |
void |
invalidate()
Invalidate the http session. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Saves an attribute in the session. |
java.lang.Object |
remove(java.lang.Object key)
Removes the specified session attribute. |
| Methods inherited from class java.util.AbstractMap |
|---|
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected javax.servlet.http.HttpSession session
protected java.util.Set<java.lang.Object> entries
protected javax.servlet.http.HttpServletRequest request
| Constructor Detail |
|---|
public SessionMap(javax.servlet.http.HttpServletRequest request)
request - the http servlet request object.| Method Detail |
|---|
public void invalidate()
public void clear()
clear in interface java.util.Mapclear in class java.util.AbstractMappublic java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class java.util.AbstractMappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class java.util.AbstractMapkey - the name of the session attribute.
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.AbstractMapkey - the name of the session attribute.value - the value to set.
public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class java.util.AbstractMapkey - the name of the attribute to remove.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||