]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1233
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Dec 2007 13:47:11 +0000 (13:47 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Dec 2007 13:47:11 +0000 (13:47 +0000)
svn changeset:3247/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java

index b6b0792a3fe0ccc46b5f50cfed6eb33efd57dfd7..f116ee25b7a62eae3f8539fc65da6a049ebedbac 100644 (file)
@@ -387,7 +387,17 @@ public class ApplicationServlet extends HttpServlet {
 
             // Get existing application
             application = getExistingApplication(request, response);
-            if (application == null) {
+            if (application == null
+                    || request.getParameter("restartApplication") != null) {
+                if (request.getParameter("restartApplication") != null
+                        && application != null) {
+                    application.close();
+                    final HttpSession session = request.getSession();
+                    if (session != null) {
+                        WebApplicationContext.getApplicationContext(session)
+                                .removeApplication(application);
+                    }
+                }
                 // Not found, creating new application
                 application = getNewApplication(request, response);
             }
@@ -723,9 +733,9 @@ public class ApplicationServlet extends HttpServlet {
         if (testingToolsServerUri == null) {
             // Default behavior is that ATFServer application exists on
             // same application server as current application does.
-            testingToolsServerUri = "http" + (request.isSecure() ? "s" : "") + "://"
-                    + request.getServerName() + ":" + request.getLocalPort()
-                    + "/ATF/ATFServer";
+            testingToolsServerUri = "http" + (request.isSecure() ? "s" : "")
+                    + "://" + request.getServerName() + ":"
+                    + request.getLocalPort() + "/ATF/ATFServer";
         }
         return testingToolsServerUri;
     }