velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: set a value in a macro
Date Wed, 24 Aug 2005 21:47:48 GMT
On 8/23/05, Robert Koberg <rob@koberg.com> wrote:
#snip 
> OR, how would you globally set a variable that is only needed in a few
> different templates? In other words, I was hoping to instantiate the
> $roles variable only when needed?
> 
> Any  ideas?

if you use the VelocityViewServlet (part of VelocityTools), you could
set some data (no arrays/lists yet, sorry) in the toolbox.xml as
<data> elements.  or you could use a servlet filter to put the values
in the servletContext attributes upon first request.  then they'll be
automatically available to all templates and subsequent requests.

---------------------------------------------------------------------
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