Session的生命周期的設(shè)置
第一種:在web.xml
加入
<session-config>
<session-timeout>15</session-timeout>
</session-config>
第二種針對專門的一個session設(shè)計
session.setMaxInactiveInterval(XXX)
在web.xml中的<servlet>加入
<load-on-startup>1</load-on-startup>
可以使servlet在容器啟動時得到加載,而不用等到第一個request的到達(dá)
posted on 2007-11-09 11:47 劉錚 閱讀(1430) 評論(4) 編輯 收藏 所屬分類: JSP and Servlet