[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-dev
Subject:    Re: VelocityServlet and getOutputStream
From:       "Geir Magnusson Jr." <geirm () adeptra ! com>
Date:       2002-07-30 18:27:35
[Download RAW message or body]

On 7/30/02 1:15 PM, "Daniel Rall" <dlr@finemaltcoding.com> wrote:

> "Geir Magnusson Jr." <geirm@adeptra.com> writes:
> 
>> On 7/30/02 8:44 AM, "Rickard" <rickard@dreambean.com> wrote:
>> 
>>> Hey
>>> 
>>> I need to change mergeTemplate() in VelocityServlet so that it uses
>>> getWriter() instead of getOutputStream() (since I have code later on
>>> that uses getWriter() and you can't mix). The easiest fix for me would
>>> be to simply subclass VelocityServlet and implement mergeTemplate() with
>>> this, but it turns out that the writerPool is private so I can't use that.
>>> 
>>> Request:
>>> 1) Either change the writerPool in VelocityServlet to protected
>>> 2) Change mergeTemplate() in VelocityServlet to use getWriter in the
>>> first place
>>> 
>>> Either would be ok.
>>> 
>>> Is there any reason in particular why getOutputStream() is used instead
>>> of getWriter() there?
>>> 
>> 
>> Because we miss you and wanted you to come back.
>> 
>> 1) Worries me as you can forget to put back.  However, one might argue that
>> you take our chances when doing this....
>> 
>> 2) Only worries is that not-Rickard will come and say "Hey, you are using
>> writer an I need the output stream later..", but as we never made any
>> promises re this, it may be ok.
>> 
>> Thinking about it, if we can keep the writer pool protected, we might as
>> well do that, so lets go with #2.
>> 
>> Anyone care if we change what mergeTemplate() uses?
> 
> What effect does this have on character encodings?

Well... In theory, none, as we would do something like

  req.setContentType()

Before doing anything.

However, this is a good question - how will this effect other parts of a
portlet app? 

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <mailto:velocity-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-dev-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic