org.apache.struts2.dispatcher
类 SessionMap<K,V>

java.lang.Object
  继承者 java.util.AbstractMap<K,V>
      继承者 org.apache.struts2.dispatcher.SessionMap<K,V>
所有已实现的接口:
Serializable, Map<K,V>

public class SessionMap<K,V>
extends AbstractMap<K,V>
implements Serializable

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.

另请参见:
序列化表格

嵌套类摘要
 
从类 java.util.AbstractMap 继承的嵌套类/接口
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
从接口 java.util.Map 继承的嵌套类/接口
Map.Entry<K,V>
 
构造方法摘要
SessionMap(javax.servlet.http.HttpServletRequest request)
          Creates a new session map given a http servlet request.
 
方法摘要
 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.
 
从类 java.util.AbstractMap 继承的方法
containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

SessionMap

public SessionMap(javax.servlet.http.HttpServletRequest request)
Creates a new session map given a http servlet request. Note, ths enumeration of request attributes will occur when the map entries are asked for.

参数:
request - the http servlet request object.
方法详细信息

invalidate

public void invalidate()
Invalidate the http session.


clear

public void clear()
Removes all attributes from the session as well as clears entries in this map.

指定者:
接口 Map<K,V> 中的 clear
覆盖:
AbstractMap<K,V> 中的 clear

entrySet

public Set<Map.Entry<K,V>> entrySet()
Returns a Set of attributes from the http session.

指定者:
接口 Map<K,V> 中的 entrySet
指定者:
AbstractMap<K,V> 中的 entrySet
返回:
a Set of attributes from the http session.

get

public V get(Object key)
Returns the session attribute associated with the given key or null if it doesn't exist.

指定者:
接口 Map<K,V> 中的 get
覆盖:
AbstractMap<K,V> 中的 get
参数:
key - the name of the session attribute.
返回:
the session attribute or null if it doesn't exist.

put

public V put(K key,
             V value)
Saves an attribute in the session.

指定者:
接口 Map<K,V> 中的 put
覆盖:
AbstractMap<K,V> 中的 put
参数:
key - the name of the session attribute.
value - the value to set.
返回:
the object that was just set.

remove

public V remove(Object key)
Removes the specified session attribute.

指定者:
接口 Map<K,V> 中的 remove
覆盖:
AbstractMap<K,V> 中的 remove
参数:
key - the name of the attribute to remove.
返回:
the value that was removed or null if the value was not found (and hence, not removed).

containsKey

public boolean containsKey(Object key)
Checks if the specified session attribute with the given key exists.

指定者:
接口 Map<K,V> 中的 containsKey
覆盖:
AbstractMap<K,V> 中的 containsKey
参数:
key - the name of the session attribute.
返回:
true if the session attribute exits or false if it doesn't exist.