velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caleb Jones" <calebjo...@gmail.com>
Subject Re: Caching for VelocityEngine's evaluate(VelocityContext, Writer, String, String) method?
Date Mon, 05 Jan 2009 23:49:12 GMT
Thanks.  That's exactly what I need.  Sorry, I didn't mention that I was
working under velocity 1.5.  I'll upgrade to 1.6.1.

On Mon, Jan 5, 2009 at 2:35 PM, Nathan Bubna <nbubna@gmail.com> wrote:

> Velocity 1.6.1 comes with a StringResourceLoader.  just specify that
> as your resource loader,
> then call StringResourceLoader.getRepository().putStringResource(String
> name, String template)  to add your templates.  Read the javadoc for
> that class for more information.
>
>
> On Mon, Jan 5, 2009 at 2:16 PM, Caleb Jones <calebjones@gmail.com> wrote:
> > This didn't seem to make it when I sent it before subscribing, so I'm
> trying
> > again (sorry for any duplication):
> >
> > I, for better or worse, need to load my velocity templates as Strings.
> > Thus, in order to parse them, I am using VelocityEngine's
> > evaluate(VelocityContext, Writer, String, String) method.  As far as I
> can
> > tell, this evaluate() method does not do AST caching, no?
> > I have three questions:
> >  1. Does the evaluate() method do AST caching?
> >  2. If not, is there a way to load a velocity template as a string and
> have
> > the velocity engine do AST caching?
> >  3. If not, how do I request this feature?  It seems like doing AST
> caching
> > for template strings passed into evaluate() would be fairly straight
> > forward.  Perhaps have this as a config option (ie:
> > string.resource.loader.cache=true).
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message