diff options
Diffstat (limited to 'id/server/moa-id-frontend-resources/src/main/java/at/gv')
-rw-r--r-- | id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/GUIFormBuilderImpl.java | 18 |
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); |