Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1183022
  • 博文数量: 252
  • 博客积分: 5421
  • 博客等级: 大校
  • 技术积分: 2418
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-17 12:59
文章分类

全部博文(252)

文章存档

2017年(3)

2016年(18)

2015年(31)

2014年(18)

2013年(7)

2012年(8)

2011年(12)

2010年(30)

2009年(32)

2008年(57)

2007年(36)

分类: Java

2008-04-15 15:45:09

1. 在\conf\web.xml中通过参数指定:

<session-config>     
    
<session-timeout>180session-timeout>       
session-config>   

单位为分钟。

2. 在程序中通过servlet api直接修改:

HttpSession session = request.getSession();    
session.setMaxInactiveInterval(18
0*60); 

单位为秒,设置为-1永不过期。

阅读(3734) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~