From fbd588f3db9dccc62c45eabdf06d3e3aa10bb940 Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Thu, 28 Dec 2006 09:59:56 +0000 Subject: Fixed bug #117 svn changeset:173/svn branch:toolkit --- .../toolkit/terminal/web/ApplicationServlet.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java index 7ed8432ee2..9ea52999aa 100644 --- a/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java @@ -494,6 +494,8 @@ public class ApplicationServlet extends HttpServlet implements HttpVariableMap variableMap = null; OutputStream out = response.getOutputStream(); HashSet currentlyDirtyWindowsForThisApplication = new HashSet(); + WebApplicationContext appContext = null; + Application application = null; try { // If the resource path is unassigned, initialize it @@ -510,7 +512,7 @@ public class ApplicationServlet extends HttpServlet implements return; // Get the application - Application application = getApplication(request); + application = getApplication(request); // Create application if it doesn't exist if (application == null) @@ -520,7 +522,6 @@ public class ApplicationServlet extends HttpServlet implements DownloadStream download = null; // Invoke context transaction listeners - WebApplicationContext appContext = null; if (application != null) { appContext = (WebApplicationContext) application.getContext(); } @@ -543,10 +544,6 @@ public class ApplicationServlet extends HttpServlet implements getApplicationManager(application).handleXmlHttpRequest( request, response); - // Notify transaction end - if (appContext != null) { - appContext.endTransaction(application, request); - } return; } @@ -731,11 +728,6 @@ public class ApplicationServlet extends HttpServlet implements handleDownload(download, request, response); } - // Notify context of transaction end - if (appContext != null) { - appContext.endTransaction(application, request); - } - } catch (UIDLTransformerException te) { try { @@ -772,6 +764,11 @@ public class ApplicationServlet extends HttpServlet implements if (transformer != null) transformerFactory.releaseTransformer(transformer); + // Notify transaction end + if (appContext != null && application != null) { + appContext.endTransaction(application, request); + } + // Clean the function library state for this thread // for security reasons ThemeFunctionLibrary.cleanState(); -- cgit v1.2.3