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 09:38:51 GMT
Nathan Bubna wrote:

>>>
>>>>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.
> 
> 
> ah.  i didn't pick up on that.  so, having once again skimmed thru
> your first email, i'm curious...  did you try the velocimacro approach
> you described?  i think it ought to work.  Jason's method should too.

I did try it and it did not work.

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