]> source.dussan.org Git - vaadin-framework.git/commitdiff
Send redirect json when the application is closed.
authorMarc Englund <marc.englund@itmill.com>
Fri, 10 Aug 2007 07:05:51 +0000 (07:05 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 10 Aug 2007 07:05:51 +0000 (07:05 +0000)
svn changeset:1980/svn branch:trunk

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

index f588c62b1068c40d54d816f7932602578ee3cc5f..7298376780aa1ef135f8c2599320d854b098a62f 100644 (file)
@@ -763,13 +763,20 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                String logoutUrl = application.getLogoutURL();
                if (logoutUrl == null)
                        logoutUrl = application.getURL().toString();
-               // clients JS app is still running, send a special xml file to
-               // tell client that application is quit and where to point browser now
+               // clients JS app is still running, send a special json file to
+               // tell client that application has quit and where to point browser now
                // Set the response type
-               response.setContentType("application/xml; charset=UTF-8");
+               response.setContentType("application/json; charset=UTF-8");
                ServletOutputStream out = response.getOutputStream();
-               out.println("<redirect url=\"" + logoutUrl + "\">");
-               out.println("</redirect>");
+               PrintWriter outWriter = new PrintWriter(new BufferedWriter(
+                               new OutputStreamWriter(out, "UTF-8")));
+               outWriter.print(")/*{");
+               outWriter.print("\"redirect\":{");
+               outWriter.write("\"url\":\"" + logoutUrl
+                               + "\"}");
+               outWriter.flush();
+               outWriter.close();
+               out.flush();
        }
 
        /**