From 7feda3d8452feb27d57a58b1373fbbf3190a9faa Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Fri, 10 Aug 2007 07:05:51 +0000 Subject: [PATCH] Send redirect json when the application is closed. svn changeset:1980/svn branch:trunk --- .../gwt/server/CommunicationManager.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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(); } /** -- 2.39.5