velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject Re: redirect Velocity
Date Fri, 09 Jan 2004 16:42:21 GMT
If you are wanting to use one Velocity template instead of another,
the best way is to include the code in your java servlet.

if (condition) template="valid.vm";
else template="invalid.vm";
Then process the template through Velocity.

If you have to do this with Velocity, you can send the Velocity
context to a general template with the code:

#if (condition)
#parse("valid.vm")
#else
#parse("invalid.vm")

This assumes that you have something in the context that lets you test
for the condition as well as containing the information needed for
valid.vm or invalid.vm.

If you are asking if Velocity can redirect to an entirely different
template (starting over) in the middle of the current template, the
answer is NO NOT EVEN A GOOD IDEA!

Barbara Baughman
X2157

On Fri, 9 Jan 2004, Giuliano wrote:

> I need to solve a doubt
> thank you!
>
> i would like to know , what i need to do to redirect a page using Velocity.
> ex:
> if i get a invalid session i want to redirect to another file.vm
> how can i do this???
>
> thank you!!
>
>       Giuliano Yoshinaga Bisse
>       Unopar - Coordenadoria de Informática
>       Programador de Sistemas
>       Visite nosso Portal: www.unopar.br
>      (43) 3371-7755
>       "Tudo posso Naquele que me fortalece"
>
>
>
>
>

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


Mime
View raw message