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 Thu, 25 Aug 2005 14:53:00 GMT
On 8/25/05, Robert Koberg <rob@koberg.com> wrote:
> 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.

hmm.  both your way and Jason's?  also, what were your velocimacro
settings in your velocity.properties? (just curious, i'm not sure if
they'll make a difference)

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