velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: How to use DataSrouceLoader in a non web application
Date Mon, 06 Aug 2007 16:20:59 GMT
You can manually create an instance of DataSourceResourceLoader, set
the DataSource on it directly using the setDataSource() method, and
then directly inject that instance into your VelocityEngine by doing
something like:

DataSourceResourceLoader dsrl = new DataSourceResourceLoader();

VelocityEngine ve = new VelocityEngine();
ve.setProperty("resource.loader", "data");
ve.setProperty("data.resource.loader.instance", dsrl);
ve.setProperty("data.resource.loader.table", "foo");
... (set keycolumn etc here)


and you should be good to go.

On 8/2/07, Ci Ci <> wrote:
> I am trying to use DataSourceResourceLoader class to load templates form a
> database. I've seen How-To on configuring it on a web application. How do
> you configure it in a non web based application?
> Thanks
> Ci Ci
> --
> View this message in context:
> Sent from the Velocity - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message