TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
function TempSave(ElementID)
{
CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value);
CommentsPersistDiv.save("CommentXMLStore");
}
function Restore(ElementID)
{
CommentsPersistDiv.load("CommentXMLStore");
document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent");
}
如果某个会话在一定的时间内未被访问,服务器可把它扔掉以节约内存。 可利用HttpSession的setMaxInactiveInterval方法直接设置个别会话对 象的超时值,也可利用web.xml给出一个适用所有服务器的明确的超时值:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!--……- - >
<session-config>
<session-timeout>2</session-timeout>
</session-config>
<!--…….- - >
</web-app>
上面的例子设置缺省的会话超时为2分钟. |
|