2013-12-20 93 views

回答

13

在您的WebAppContext上访问会话处理/管理并进行设置。

WebAppContext app = new WebAppContext(....); 
... 
app.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout); 

这是怎么样Jetty itself does it

注意:SessionManager.setMaxInactiveInterval(int)以秒为单位,而不是毫秒。

相关问题