velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: set a value in a macro
Date Thu, 25 Aug 2005 00:42:22 GMT
Nathan Bubna wrote:
> 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.

Hi,
thanks, but I was looking for a way to keep it available, but not put it 
into memory unless I needed it.

It is not a bug deal (the array contains 11 items...), just checking.

best,
-Rob

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