weblogic10.3中三种配置会话超时的方法


weblogic10.3中三种配置会话超时的方法如下:

1、The File web.xml

Edit the session-timeout of the session-config in the file web.xml. Please note in web.xml, the session timeout is set in minutes.


 60


IMPORTANT:
The timeout value set in web.xml takes precedence over weblogic.xml. If you don't set any values in web.xml, weblogic.xml takes over. A good approach to handle session timeout is setting this just on web.xml itself since web.xml takes precedence over application server’s deployment descriptors.


2、The File weblogic.xml

Edit the session-param TimeoutSecs in the file weblogic.xml. In weblogic.xml, the session timeout is set in seconds.


 
  TimeoutSecs
  3600
 



3、Application Code

Setting this parameter by java code on your servlet or JSP file. This is a method in the public interface HttpSession.

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.

Public int getMaxInactiveInterval()

Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26194851/viewspace-750105/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26194851/viewspace-750105/

你可能感兴趣的:(weblogic10.3中三种配置会话超时的方法)