posts - 10,comments - 2,trackbacks - 0
          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 閱讀(10158) 評論(1)  編輯  收藏 所屬分類: J2EE

          FeedBack:
          # re: Java Session超時設置
          2016-06-12 16:49 | 1212
          323243424  回復  更多評論
            

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 于田县| 洛扎县| 文成县| 岚皋县| 吉木乃县| 昌宁县| 富源县| 浦江县| 湾仔区| 调兵山市| 雷山县| 辽宁省| 贵阳市| 甘肃省| 临高县| 巴东县| 嘉鱼县| 招远市| 安阳市| 浦江县| 辽阳县| 高淳县| 碌曲县| 仁寿县| 荣成市| 陵水| 三台县| 永修县| 新源县| 九江县| 且末县| 天门市| 泸水县| 克什克腾旗| 辽阳市| 福鼎市| 封丘县| 体育| 朔州市| 汝州市| 罗山县|