`

setMaxInactiveInterval和session-config的比较

Web 
阅读更多
setMaxInactiveInterval和session-config的优先级:
1、setMaxInactiveInterval的优先级高,如果setMaxInactiveInterval没有设置,则默认是session-config中设置的时间。
2、setMaxInactiveInterval设置的是当前会话的失效时间,不是整个web服务的。
3、setMaxInactiveInterval的参数是秒,session-config当中配置的session-timeout是分钟。
分享到:
评论

相关推荐

    session过期时间设置

    在主页面或者公共页面中加入:session.setMaxInactiveInterval(900); 参数900单位是秒,即在没有活动15分钟后,session将失效。 这里要注意这个session设置的时间是根据服务器来计算的,而不是客户端。所以如果是...

    java-servlet-api.doc

    随着时间的过去,发展了许多会话跟踪的技术,但是使用起来都比较麻烦。 JavaServletAPI提供了一个简单的接口,通过这个接口,Servlet引擎可以有效地跟踪用户的会话。 建立Session 因为HTTP是一个请求-响应协议,一...

    课程设计(JSP)代码第2章

    ;charset=gb2312" import="java.sql.*... session.setMaxInactiveInterval(-1); %> <tr><td align="center">投票"> <tr><td align="center">查看投票</a></td> <p><a href="manage.jsp">投票系统维护 </body></html>

    可以查看上线人数 监听器 servlet Ajax聊天系统

    session.setMaxInactiveInterval(100);//设置session时间 Vector vector=list.getList(); //对象数组 if(vector!=null&&vector.size()>0){//如果对象数组不为空,大小 for(int i=0;i();i++){ out.println(vector....

    jsp内置对象的用法

    9 void setMaxInactiveInterval() 设置两次请求间隔多长时间此SESSION被取消(ms) 4.out对象 out对象是JspWriter类的实例,是向客户端输出内容常用的对象 序号 方 法 说 明 1 void clear() 清除缓冲区的内容 ...

    JSP单元测试题JNDI JAVA Naming and Directory interface

    对于session对象的setMaxInactiveInterval(int interval) 如果参数设置为负数.....

    java开发资料

    Returns the maximum time interval, in seconds, that ... The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout. Returns:

    jsp新闻发布系统

    session.setMaxInactiveInterval(1800) ; response.sendRedirect("newslist.jsp") ; }else response.sendRedirect("wrong.jsp") ; } %> <td height="125" colspan="3" bgcolor="#CCFF00"><marquee ...

Global site tag (gtag.js) - Google Analytics