aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources/src
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-09-30 09:22:29 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-09-30 09:22:29 +0200
commitd025c38a426e22b0d1ccfbb4558ff6ce78ac1d0b (patch)
tree6bd538b3faab08ecec07c1fcff47e4c84f483b47 /id/server/moa-id-frontend-resources/src
parent5dda0359afcdc69b11bc9a8df5c527e6c1488b6f (diff)
downloadmoa-id-spss-d025c38a426e22b0d1ccfbb4558ff6ce78ac1d0b.tar.gz
moa-id-spss-d025c38a426e22b0d1ccfbb4558ff6ce78ac1d0b.tar.bz2
moa-id-spss-d025c38a426e22b0d1ccfbb4558ff6ce78ac1d0b.zip
refactor http servlet response processing to prohibit 'chunked' transfer encoding
Diffstat (limited to 'id/server/moa-id-frontend-resources/src')
-rw-r--r--id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java
index 26b37226d..e77933986 100644
--- a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java
+++ b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java
@@ -101,11 +101,23 @@ public class GUIFormBuilderImpl implements IGUIFormBuilder {
//evaluate template
StringWriter writer = new StringWriter();
engine.evaluate(context, writer, loggerName, new BufferedReader(new InputStreamReader(is)));
-
+
//write template to response
+ final byte[] content = writer.toString().getBytes("UTF-8");
httpResp.setStatus(HttpServletResponse.SC_OK);
- httpResp.setContentType(contentType);
- httpResp.getOutputStream().write(writer.toString().getBytes("UTF-8"));
+ httpResp.setContentLength(content.length);
+ httpResp.setContentType(contentType);
+ httpResp.getOutputStream().write(content);
+
+ if (Logger.isTraceEnabled()) {
+ Logger.trace("Write Content for viewName:" + viewName
+ + ". Contentsize:" + String.valueOf(content.length)
+ + " BufferSize:" + httpResp.getBufferSize()
+ + " ContentType:" + contentType);
+ for (String el : httpResp.getHeaderNames())
+ Logger.trace(" * Headername:" + el + " Value:" + httpResp.getHeader(el));
+
+ }
} catch (IOException e) {
Logger.error("GUI form-builder has an internal error.", e);