DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24584>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24584

Make VelocityViewServlet fall back to response.getOutputStream() if getWriter() fails





------- Additional Comments From [EMAIL PROTECTED]  2003-11-11 20:30 -------
ok, i understand the second check for '='.  a little paranoid maybe, but doesn't
hurt anything. :)

as your suggestion per the encoding member, i don't think you understood my
counter-proposal.  i understand that we need an encoding for the output stream,
i am suggesting that we do not store it ourselves, but let the response handle
that as it is designed to.  when we need the encoding for the output stream, we
just get it from response.getCharacterEncoding().  

this makes things much simpler on us and takes in account anything that a
subclass might do to change encoding (e.g. their own setContentType()
implementation or any direct calls to response.setContentType() or
response.setLocale())

and yeah, your right. we'll need to make error() fall back to the outputstream
too.  i suggest we use this for both:

protected Writer getResponseWriter(HttpServletResponse response) {
    Writer writer = null;
    try
    {
        writer = response.getWriter();
    }
    catch (IllegalStateException e)
    {
        Velocity.warn("blah blah deprecated blah blah");
        String encoding = response.getCharacterEncoding();
        if (encoding == null)
        {
            encoding = DEFAULT_OUTPUT_ENCODING;
        }
        writer = new OutputStreamWriter(response.getOutputStream(), encoding);
    }
    return writer;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to