aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeamcity <build@vaadin.com>2015-04-24 10:07:46 +0300
committerTeamcity <build@vaadin.com>2015-04-24 10:07:46 +0300
commit782984ff388c41a4582f70285fd973d131a1e117 (patch)
tree16e28fd5ac894eaa7266f9857c21f7dbaba43884
parent359ef230ac8143019628557aa4d1ada26b9b8a6a (diff)
parent7572ef713e218f29ca316652f13cf6eef88d1c0b (diff)
downloadvaadin-framework-782984ff388c41a4582f70285fd973d131a1e117.tar.gz
vaadin-framework-782984ff388c41a4582f70285fd973d131a1e117.zip
Merge branch 'refs/heads/master' into 'snapshot/7.5'
-rw-r--r--server/src/com/vaadin/server/communication/UidlRequestHandler.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/server/src/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/com/vaadin/server/communication/UidlRequestHandler.java
index d28107e8f8..6e338c5773 100644
--- a/server/src/com/vaadin/server/communication/UidlRequestHandler.java
+++ b/server/src/com/vaadin/server/communication/UidlRequestHandler.java
@@ -36,6 +36,7 @@ import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.JsonConstants;
import com.vaadin.shared.Version;
import com.vaadin.ui.UI;
+
import elemental.json.JsonException;
/**
@@ -70,7 +71,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements
if (uI == null) {
// This should not happen but it will if the UI has been closed. We
// really don't want to see it in the server logs though
- response.getWriter().write(
+ UIInitHandler.commitJsonResponse(request, response,
getUINotFoundErrorJSON(session.getService(), request));
return true;
}
@@ -99,18 +100,14 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements
} catch (JsonException e) {
getLogger().log(Level.SEVERE, "Error writing JSON to response", e);
// Refresh on client side
- response.getWriter().write(
- VaadinService.createCriticalNotificationJSON(null, null,
- null, null));
+ writeRefresh(request, response);
return true;
} catch (InvalidUIDLSecurityKeyException e) {
getLogger().log(Level.WARNING,
"Invalid security key received from {0}",
request.getRemoteHost());
// Refresh on client side
- response.getWriter().write(
- VaadinService.createCriticalNotificationJSON(null, null,
- null, null));
+ writeRefresh(request, response);
return true;
} finally {
stringWriter.close();
@@ -142,6 +139,13 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements
}
}
+ private void writeRefresh(VaadinRequest request, VaadinResponse response)
+ throws IOException {
+ String json = VaadinService.createCriticalNotificationJSON(null, null,
+ null, null);
+ UIInitHandler.commitJsonResponse(request, response, json);
+ }
+
private void writeUidl(VaadinRequest request, VaadinResponse response,
UI ui, Writer writer, boolean repaintAll) throws IOException {
openJsonMessage(writer, response);