freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany (JIRA)" <>
Subject [jira] [Commented] (FREEMARKER-59) include_page directive does not work in weblogic
Date Thu, 15 Jun 2017 12:43:00 GMT


Daniel Dekany commented on FREEMARKER-59:

{{getOutputStream()}} is for writing binary responses, so I don't understand why WebLogic
does that. Is it possible that it thinks that the included resource is binary? At very least
we should throw an exception when {{getOutputStream()}} is called, because in fact it can't
be correctly implement over a {{Writer}}. It's impossible to translate an arbitrary binary
to characters, unless something guarantees that the the binary actually only contains characters
encoding with a known charset. {{ServletOutputStream()}} (note that it's not just {{OutputStream}}
either) doesn't tell anything about the charset, at least not in the JavaDoc-s. (It's funny
BTW because then the result of {{out.print("blah")}} is undefined. Jetty for example throws
exception if there's a non-US-ASCII character in the input. Clearly this part of the Servlet
API was designed hastily. Anyway, we aren't affected by {{out.print(String)}}, just saying...)

> include_page directive does not work in weblogic
> ------------------------------------------------
>                 Key: FREEMARKER-59
>                 URL:
>             Project: Apache Freemarker
>          Issue Type: Improvement
>          Components: engine, jsp
>    Affects Versions: 2.3.24-incubating, 2.3.25-incubating, 2.3.26-incubating
>         Environment:  java 8 / weblogic
>            Reporter: Dawid van der Merwe
>              Labels: newbie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> The include_page directive implemented in freemarker.ext.servlet.IncludePage does not
handle jsp includes correctly in weblogic 12c (only version tested).
> This seems to be because the HttpServletResponseWrapper (wrappedResponse) created on (line 105) only overrides getWriter() and not getOutputStream(). Weblogic
jsp's seem to write to the response's servlet output stream and not its writer.
> The effect is that the output of the jsp is written directly to the response's output
and not to the freemarker environment's output.
> I corrected the behaviour by also overriding  getOutputStream() and using commons-io's
WriterOutputStream to convert the stream's bytes.
> I can provide my (hasty) patch if required.

This message was sent by Atlassian JIRA

View raw message