velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tlecavel\.ml" <tlecavel...@laposte.net>
Subject Batch a template?
Date Thu, 18 May 2006 15:08:54 GMT
Hello,

The process to evaluate a template is quite long and take many
ressources on the CPU. Is it possible to "batch" a template
with a set of different context to save time?

I explain: at this time a have a function that do something like:

  StringBuffer buffer = new StringBuffer();

  Velocity.init();
  VelocityContext context = new VelocityContext(voContext);

  StringWriter w = new StringWriter();

  Velocity.evaluate(context, w,
       getConfig().getProperty("velocity.logFile"),
       template);

  buffer.append(w);
  return buffer;

And this block is called about a hundred of times where only
voContext is modified. Is there a way to evaluate just once
the template and then give Velocity a list of context to treat?

Thanks for your help.

-- Thomas.

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




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