1、jsp頁(yè)面直接設(shè)置1 // 設(shè)置秒數(shù)
2 session.setMaxInactiveInterval(10);
2、web.xml設(shè)置,會(huì)覆蓋tomcat下conf/web.xml的session-config設(shè)置
<session-config>
<!-- 配置session的超時(shí)管理,以分鐘為單位 -->
<session-timeout>30</session-timeout>
</session-config>
3、如果服務(wù)器為tomcat的話,則在conf/web.xml下修改
1 <session-config>
2 <!-- 配置session的超時(shí)管理,以分鐘為單位 -->
3 <session-timeout>30</session-timeout>
4 </session-config>
4、在server.xml中設(shè)置超時(shí)時(shí)間
1 <Context path="/livsorder" docBase="/home/httpd/html/livsorder"
2 defaultSessionTimeOut="3600" isWARExpanded="true"
3 isWARValidated="false" isInvokerEnabled="true"
4 isWorkDirPersistent="false"/>
優(yōu)先級(jí):1>2>3>4
posted on 2011-07-21 21:40
showsun 閱讀(10152)
評(píng)論(1) 編輯 收藏 所屬分類:
J2EE