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