From 5e83485e9bb1df9e2214a936b7b10fe3e0ca5dfc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 28 Aug 2009 13:33:12 +0000 Subject: [PATCH] Fix for #3167 - IllegalStateExcepton when session expires svn changeset:8578/svn branch:6.1 --- .../gwt/server/AbstractApplicationServlet.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index a9e30bdb67..0e1566ad0e 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -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); -- 2.39.5