velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wglasshus...@gmail.com>
Subject Re: Error in intializing Velocity for StringResourceLoader
Date Sun, 29 Jun 2008 21:24:50 GMT
Thanks for letting us know!

On Sat, Jun 28, 2008 at 7:16 AM, Amit Jagtap <amit.jagtap@gmail.com> wrote:

>
> Hi,
>
> the mentioned issue got resolved..
> had to add the following-
>             VelocityEngine ve = new VelocityEngine();
>            Properties p = new Properties();
>             p.setProperty( "resource.loader", "string" );
>            p.setProperty( "string.resource.loader.description", "Velocity
> StringResource loader" );
>            p.setProperty( "string.resource.loader.class",
> "org.apache.velocity.runtime.resource.loader.StringResourceLoader" );
>            ve.init(p);
>
>
> it was given in the javadoc :P
> the age old unix adage is true till date - "RTFM" :)
>
> Thanks,
> Amit
>
>
>
> Amit Jagtap wrote:
> >
> > I am trying to invoke Velocity using following code-
> >
> > VelocityEngine ve = new VelocityEngine();
> >
> > Properties p = new Properties();
> > p.setProperty( "resource.loader", "String" );
> > p.setProperty( "class.resource.loader.class",
> > "org.apache.velocity.runtime.resource.loader.StringResourceLoader" );
> >
> > ve.init(p);
> >
> > VelocityContext context = new VelocityContext();
> >
> >
> > I am trying to do the above after reading javadoc for
> > ClasspathResourceLoader. the javadoc says-
> > resource.loader = class class.resource.loader.class =
> > org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> > should be used. I tried these properties and my templates are loaded from
> > classpath.
> >
> > But now I need to create my templates dynamically. For this I am using
> > StringResourceLoader. But after the above mentioned initialization of
> > Velocity, I get following error-
> > WARNING: ResourceManager : No configuration information for resource
> > loader named 'String'. Skipping.
> >
> > Please help me in this issue. How do I initialise VelocityEngine to load
> > velocity templates using StringResourceLoader
> >
> > Thanks and Regards,
> > Amit
> >
>
> --
> View this message in context:
> http://www.nabble.com/Error-in-intializing-Velocity-for-StringResourceLoader-tp18169294p18171137.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message