ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1446628 - /ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
Date Fri, 15 Feb 2013 15:16:14 GMT
Author: marrs
Date: Fri Feb 15 15:16:14 2013
New Revision: 1446628

URL: http://svn.apache.org/r1446628
Log:
ACE-318 in the web UI, a session now times out after being idle for 2 minutes.

Modified:
    ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java

Modified: ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java?rev=1446628&r1=1446627&r2=1446628&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
(original)
+++ ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinServlet.java
Fri Feb 15 15:16:14 2013
@@ -24,6 +24,7 @@ import java.util.Dictionary;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
 
 import org.apache.ace.authentication.api.AuthenticationService;
 import org.apache.ace.client.repository.SessionFactory;
@@ -35,9 +36,12 @@ import org.osgi.service.useradmin.UserAd
 
 import com.vaadin.Application;
 import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
+import com.vaadin.terminal.gwt.server.WebApplicationContext;
 
 public class VaadinServlet extends AbstractApplicationServlet implements ManagedService {
-    private static final long serialVersionUID = 1L;
+    private static final int SESSION_TIMEOUT = 120; // in seconds (so 120 = 2 minutes)
+
+	private static final long serialVersionUID = 1L;
     
     public static final String PID = "org.apache.ace.webui.vaadin";
     
@@ -87,6 +91,14 @@ public class VaadinServlet extends Abstr
         );
         return application;
     }
+    
+    @Override
+	protected WebApplicationContext getApplicationContext(HttpSession session) {
+		if (session.getMaxInactiveInterval() != SESSION_TIMEOUT) {
+			session.setMaxInactiveInterval(SESSION_TIMEOUT);
+		}
+		return super.getApplicationContext(session);
+	}
 
     public void updated(Dictionary dictionary) throws ConfigurationException {
         if (dictionary != null) {
@@ -131,5 +143,4 @@ public class VaadinServlet extends Abstr
             m_obrUrl = obrUrl;
         }
     }
-
 }



Mime
View raw message