aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-04-19 16:30:18 +0300
committerArtur Signell <artur@vaadin.com>2012-04-19 22:10:35 +0300
commit3e374618c128f8a740909b344399fff8796a6d2c (patch)
tree52e7cd426cba13e4fb8eaff196840f631a059f6f /src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
parent0d13b7f8216fe63f08f04844dfe7f0c62eee1f87 (diff)
downloadvaadin-framework-3e374618c128f8a740909b344399fff8796a6d2c.tar.gz
vaadin-framework-3e374618c128f8a740909b344399fff8796a6d2c.zip
Fixed GateIn portal support and action request problem (#8670)
Diffstat (limited to 'src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java')
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 56e99450d2..e772aec6cc 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -2118,7 +2118,18 @@ public abstract class AbstractCommunicationManager implements Serializable {
String initialUIDL = getInitialUIDL(combinedRequest, root);
params.put("uidl", initialUIDL);
}
- response.getWriter().write(params.toString());
+
+ // NOTE! GateIn requires, for some weird reason, getOutputStream
+ // to be used instead of getWriter() (it seems to interpret
+ // application/json as a binary content type)
+ final OutputStream out = response.getOutputStream();
+ final PrintWriter outWriter = new PrintWriter(new BufferedWriter(
+ new OutputStreamWriter(out, "UTF-8")));
+
+ outWriter.write(params.toString());
+ // NOTE GateIn requires the buffers to be flushed to work
+ outWriter.flush();
+ out.flush();
} catch (RootRequiresMoreInformationException e) {
// Requiring more information at this point is not allowed
// TODO handle in a better way