velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: How do I specific template in jar file?
Date Mon, 01 Nov 2004 23:38:58 GMT
Hi Carfield,

> Velocity.mergeTemplate("/path/to/template.wm", "UTF-8", velocityContext,
> writer);
This should do.  AFAIK, there are two ways to get templates from jars:
    http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.html
    http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/loader/JarResourceLoader.html

Both will work that way.  ;)

Oh yes, for the classpath loader, you have to get rid of the leading slash, like
    Velocity.mergeTemplate("path/to/template.wm", ...

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai <shinobu.kawai@gmail.com>

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