From: Marc Englund Date: Fri, 10 Aug 2007 07:05:51 +0000 (+0000) Subject: Send redirect json when the application is closed. X-Git-Tag: 6.7.0.beta1~6124 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7feda3d8452feb27d57a58b1373fbbf3190a9faa;p=vaadin-framework.git Send redirect json when the application is closed. svn changeset:1980/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java index f588c62b10..7298376780 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java @@ -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(""); - out.println(""); + 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(); } /**