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 Tue, 24 Jun 2008 22:28:30 GMT
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 that true, or is there a way to forward to a different page directly
> from logic in a .vm w/o JavaScript?

not unless you do the above, in which case $response.sendRedirect(url)
should do the trick.

>
>  For example:
>
>   #if ($myVar == null)
>        #redirect to some other page
>   #end
>
> Thanks,
>
> Tim
>
>
> This communication is the property of Qwest and may contain confidential or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful.  If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
>

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


Mime
View raw message