]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #3167 - IllegalStateExcepton when session expires
authorArtur Signell <artur.signell@itmill.com>
Fri, 28 Aug 2009 13:33:12 +0000 (13:33 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 28 Aug 2009 13:33:12 +0000 (13:33 +0000)
svn changeset:8578/svn branch:6.1

src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java

index a9e30bdb67af67957f313808d270942876fde88a..0e1566ad0e2e2fc7f443493dc9694079e3869408 100644 (file)
@@ -913,17 +913,22 @@ public abstract class AbstractApplicationServlet extends HttpServlet {
                 // just go ahead redirect the browser
                 response.sendRedirect(ci.getSessionExpiredURL());
             } else {
-                // send uidl redirect
-                criticalNotification(request, response, ci
-                        .getSessionExpiredCaption(), ci
-                        .getSessionExpiredMessage(), null, ci
-                        .getSessionExpiredURL());
                 /*
                  * Invalidate session (weird to have session if we're saying
                  * that it's expired, and worse: portal integration will fail
                  * since the session is not created by the portal.
+                 * 
+                 * Session must be invalidated before criticalNotification as it
+                 * commits the response.
                  */
                 request.getSession().invalidate();
+
+                // send uidl redirect
+                criticalNotification(request, response, ci
+                        .getSessionExpiredCaption(), ci
+                        .getSessionExpiredMessage(), null, ci
+                        .getSessionExpiredURL());
+
             }
         } catch (SystemMessageException ee) {
             throw new ServletException(ee);