|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
org.apache.struts2.dispatcher.SessionMap<K,V>
public class SessionMap<K,V>
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 class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected Set<Map.Entry<K,V>> |
entries
|
protected HttpServletRequest |
request
|
private static long |
serialVersionUID
|
protected HttpSession |
session
|
Constructor Summary | |
---|---|
SessionMap(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. |
boolean |
containsKey(Object key)
Checks if the specified session attribute with the given key exists. |
Set<Map.Entry<K,V>> |
entrySet()
Returns a Set of attributes from the http session. |
V |
get(Object key)
Returns the session attribute associated with the given key or null if it doesn't exist. |
void |
invalidate()
Invalidate the http session. |
V |
put(K key,
V value)
Saves an attribute in the session. |
V |
remove(Object key)
Removes the specified session attribute. |
Methods inherited from class java.util.AbstractMap |
---|
clone, 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 |
---|
private static final long serialVersionUID
protected HttpSession session
protected Set<Map.Entry<K,V>> entries
protected HttpServletRequest request
Constructor Detail |
---|
public SessionMap(HttpServletRequest request)
request
- the http servlet request object.Method Detail |
---|
public void invalidate()
public void clear()
clear
in interface Map<K,V>
clear
in class AbstractMap<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
entrySet
in class AbstractMap<K,V>
public V get(Object key)
get
in interface Map<K,V>
get
in class AbstractMap<K,V>
key
- the name of the session attribute.
public V put(K key, V value)
put
in interface Map<K,V>
put
in class AbstractMap<K,V>
key
- the name of the session attribute.value
- the value to set.
public V remove(Object key)
remove
in interface Map<K,V>
remove
in class AbstractMap<K,V>
key
- the name of the attribute to remove.
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
key
- the name of the session attribute.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |