velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <>
Subject Re: Loading templates from classpath
Date Fri, 01 Apr 2005 20:40:13 GMT
Hi seba,

Let's keep it on the list.  No secrets.  ;)

> My problem is that I would like to set the loader programmatically. I do
> not want to set up web.xml or similar. I just want to start jetty and
> have the servlet initialisation code (or whatever initialisation code
> must be) set the loader to the ClasspathResourceLoader, and finally have
> templates read from the jar.

If you aren't going to customise your web.xml, how are you going to
let the servlet container know which servlet to use?  Or am I missing
something about jetty?
Anyways, _if_ you're willing to edit your web.xml, it's as simple as
setting your

> I have the idea that this should be doable by overriding
> loadConfiguration() and setting something either in the Velocity runtime
> or in the properties obtained by super.loadConfiguration( config ).
> Again I could not find any examples about this.

You got the picture!  A partial sample can be found here:

Best regards,
-- Shinobu

Shinobu Kawai <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message