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: 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 velocity.properties.
     http://jakarta.apache.org/velocity/tools/view/

> 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:
     http://jakarta.apache.org/velocity/developer-guide.html#Miscellaneous%20Details

Best regards,
-- Shinobu

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