VelocityEngine doesn't have any static methods, and resource loaders
should be set via the configuration properties, not the application
attributes. Please be sure you have read the documentation on
configuring resource loaders.
that said, you will probably end up doing something like this:
VelocityEngine engine = new VelocityEngine();
engine.setProperty("resource.loader", "mine");
engine.setProperty("mine.resource.loader.instance", new MyResourceLoader());
On Wed, Nov 12, 2008 at 12:46 PM, Walid jo Gedeon <[EMAIL PROTECTED]> wrote:
> Hello all!
> I'm using Velocity to generate a service's output (telnetservice).
> It works excellently as a standalone app, however fails to find my
> resources in the context a bundle running on an osgi framework (felix in
> this case).
>
> It looks like the bundling and dependencies makes it so that the velocity
> classpath resource loader cannot see my resources.
> I'm looking for a way to set the resource loader to one that I would
> implement and that would live in my context, and provide the resources to
> velocity...
>
> VelocityEngine.setApplicationAttribute(VelocityEngine.RESOURCE_LOADER,
> new ClasspathResourceLoader())
> was my best bet, but it doesnt work? tried it before and after the init(),
> am I missing another call for it to make it to the resource manager's
> resource loaders list?
>
> Unfortunately, I can't use the property "resource.loader" because my
> resource loader class would not be visible from the velocity context.
>
> ideas? :-)
> w
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]