<code id="qf3hh"></code>
  • <menuitem id="qf3hh"></menuitem>
  • <strike id="qf3hh"><label id="qf3hh"></label></strike>

  • ?
      開發(fā)技術(shù) / Technology

      web.xml配置Session超時時間注意的單位問題

      日期:2015年4月23日  作者:zhjw  來源:互聯(lián)網(wǎng)    點擊:1182

      為單個Web應(yīng)用 配置超時時間可以在web.xml中使用<session-config>元素,如 

       .... 
      <web-app>
       
      <!--filter.listener,servlet,and servlet-mapping等元素要在session-config之前-->
          <session-config>
               <session-timeout>15 </session-timeout>
          </session-config>
          ... 

      </web-app> 
      這個時候的“15”單位是分鐘!


      如果在配置Servlet是指定初始化參數(shù)決定超時時間,例如下:

      ....
      <servlet>
          <servlet-name>Example</servlet-name>
          <servlet-class>exa.mp.le.Example2</servlet-class>
          <init-param>
               <param-name>timeout</param-name>
               <param-value>600</param-value>
         </init-param>
      ...
      </servlet>
      這時候的“600”單位是秒鐘!


      另外,我們要注意HttpSession.getMaxInactiveInterval()方法返回的是與秒為單位的;

      session.setMaxInactiveInterval(int seconds)方法參數(shù)的單位也是秒。

       

      国产一级婬片AAA毛,无码中文精品视视在线观看,欧美日韩a人成v在线动漫,五月丁香青草久久
      <code id="qf3hh"></code>
    • <menuitem id="qf3hh"></menuitem>
    • <strike id="qf3hh"><label id="qf3hh"></label></strike>