public interface ISession
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
getAttribute(String name)
获取会话中存储的对象
|
Enumeration<String> |
getAttributeNames()
获取会话中存储的所有对象名称
|
long |
getCreationTime()
获取会话创建时间
|
String |
getId()
获取会话ID
|
long |
getLastAccessedTime()
获取会话最近访问时间
|
int |
getMaxInactiveInterval()
获取会话超时时间(单位:秒)
|
void |
invalidate()
终止会话,释放会话中的所有对象
|
boolean |
isNew()
是否新建的会话,即客户端还没有请求第二次
|
void |
removeAttribute(String name)
移除指定对象
|
void |
setAttribute(String name,
Object value)
设置对象
|
void |
setMaxInactiveInterval(int interval)
设置会话超时时间(单位:秒)
|
<T> T getAttribute(String name)
name - 对象名称Enumeration<String> getAttributeNames()
long getCreationTime()
String getId()
long getLastAccessedTime()
int getMaxInactiveInterval()
void invalidate()
boolean isNew()
void removeAttribute(String name)
name - 对象名称void setMaxInactiveInterval(int interval)
interval - 超时时间(单位:秒),如果设置为0或负数,则永不超时Copyright © 2020. All Rights Reserved.