setMaxInactiveInterval(int seconds);
seconds是负数表示永不超时。
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
seconds是负数表示永不超时。
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
解决方案 »
- 求助:DBCP borrowObject failed: java.sql.SQLException: Io 异常: The Network Adapter
- 最近做了一款基于AJax的资源管理器和数据库管理器,支持所有平台、数据库和浏览器。大家帮我评估一下!
- SQL 2000 根据子ID 查 父ID 的值。
- STRUTS中request.findforward();转向传值问题!!!
- 关于北京神州数码的问题,请知情者发表看发!
- 基于j2ee平台的大型电子上午网站源代码下载
- 输出的日期怎么是:???,21 ?? 2004
- 高手来帮帮我!!!!!!!!!关于rs.close,stmt.close,conn.close的问题
- 为什么会出现这样的问题?
- 怎么没人回答我的问题?
- [ 请教]关于jsp配置环境问题!
- j2eeSDK与j2seSDK有什么不同!!
session的生存期是从用户打开一个页面 到关闭,
默认好象是20分钟,如果时间较长,仅管用户没有关闭,session也失效,
所以想设成无限长!!(也就是到用户关闭页面)
不知对不对
Parameters:
interval - An integer specifying the number of seconds看看文档吧,这个方法的参数如果是负值,就会让session永远不会失效。
session.setMaxInactiveInterval(int seconds);