aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources/src/main
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-10-07 07:44:58 +0200
commit961f785060f749ed97b0516745cb9ad2fd2704cc (patch)
tree23c10876368166f1e65a6719d31ae81784d54b8f /id/server/moa-id-frontend-resources/src/main
parent58c843aa630c1e6fd2680cf019f7e270abbe9a69 (diff)
downloadmoa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.tar.gz
moa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.tar.bz2
moa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.zip
refactor http servlet response processing to prohibit 'chunked' transfer encoding
Diffstat (limited to 'id/server/moa-id-frontend-resources/src/main')
-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);