velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Server-side redirect from VelocityTools?
Date Wed, 25 Jun 2008 15:57:54 GMT
On Wed, Jun 25, 2008 at 7:11 AM, Christopher Schultz
<chris@christopherschultz.net> wrote:
> Nathan,
>
> Nathan Bubna wrote:
>>
>> On Tue, Jun 24, 2008 at 3:13 PM, White, Tim <Tim.White@qwest.com> wrote:
>>>
>>> Hi -
>>>
>>>  I'm pretty sure that since the response is already set by the time that
>>> a .vm template is running via VelocityViewServlet, that you can't do a
>>> server-side redirect at that point.
>>
>> True, unless you are using VelocityTools 2 and set:
>>
>>   org.apache.velocity.tools.bufferOutput
>>
>> to true in your servlet's init-params.
>
> Is it true? I think you get a default buffer for output from the
> ServletOutputStream in the first place, so there's some wiggle-room.

that wouldn't be something i'd rely on.

> I often set the Content-Type in my VMs.
>
> Hmm... but I am using VelocityLayoutServlet, which I think builds the whole
> response in memory before streaming it. That could definitely be a factor.

yeah, in VLS, the requested template is fully buffered so it can be
inserted into the layout template.   this means you can redirect from
the requested template, but not from the layout template.

> -chris
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message