velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xavier Noria <...@hashref.com>
Subject instantiating templates from Strings and absolute paths
Date Mon, 18 Jul 2005 08:59:04 GMT
I am writing an application that needs a couple of functionalities I  
don't see in the developer's manual.

On the one hand I have snippets of templates in a XML file. I've read  
Velocity.evaluate() can instantiate them, but I would prefer to have  
a "precompiled" Template object (I'm new to Velocity and I am in fact  
assuming an object of type Template is a precompiled template). Is  
that possible or should I need to write my own StringReso

On the other hand, looks like there is no direct way to create  
Template objects given an absolute path, except by computing its  
dirname, setting it as template root dir, then load the basename as  
relative path. I've seen another workaround which consists of setting  
the root dir to the empty string. Isn't there a more convinient way  
like a simple method call?

-- fxn



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