You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by zz...@enflamed.com on 2004/04/04 15:14:01 UTC
get Template from memory
Hi!
I can't find a way to get a Velocity Template from memory.
The only way I found is by it's filename:
VelocityEngine ve = new VelocityEngine();
Template t = ve.getTemplate("fileNameOfTemplate");
Is there a direct way (without creating a file) in Velocity
to get a Template from memory (e.g. from a String object)?
Thanks,
-Toddy
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: get Template from memory
Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Apr 4, 2004, at 9:14 AM, zzztoddy.marxzzz@enflamed.com wrote:
>
> Hi!
>
> I can't find a way to get a Velocity Template from memory.
> The only way I found is by it's filename:
>
> VelocityEngine ve = new VelocityEngine();
> Template t = ve.getTemplate("fileNameOfTemplate");
>
> Is there a direct way (without creating a file) in Velocity
> to get a Template from memory (e.g. from a String object)?
There's no way to get a template at the moment (although I did think of
a resource loader that I'm going to cobble together today to do
this...)
Until then, look at the o.a.velocity.app.Velocity and VelocityEngine
APIs. They have a evaluate() method that will help
geir
>
> Thanks,
>
> -Toddy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-247-1713(m)
geir@4quarters.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org