4 回答
TA贡献1803条经验 获得超3个赞
removeAttribute 方法说明
void removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.
After this method executes, and if the object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueUnbound. The container then notifies any HttpSessionAttributeListeners in the web application.
Parameters:
name - the name of the object to remove from this session
Throws:
IllegalStateException - if this method is called on an invalidated session
很显然session超时失效了,你在失效的session上调用方法就会出现你说的问题了。
添加回答
举报