依靠Web服务器的设置,JSP中也可以手工设置。
可以看看配置文档

解决方案 »

  1.   

    setMaxInactiveInterval
    public void setMaxInactiveInterval(int interval)
    Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
    Parameters:
    interval - An integer specifying the number of seconds--------------------------------------------------------------------
    一般J2EEServer控制台都有相关的设置选项
      

  2.   

    我用的是tomcat,JSP放在root下,请问应该如何设置呢?
      

  3.   

    如果你用的是webshpere,在控制台里面有相关设置。
      

  4.   

    我还用过weblogic,都在应用服务器的控制台中
      

  5.   

    在conf/web.xml里有你打开就可以设置时间了默认的是 30