2013-12-20 136 views

回答

13

在您的WebAppContext上訪問會話處理/管理並進行設置。

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

這是怎麼樣Jetty itself does it

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

相關問題