velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Jagtap <amit.jag...@gmail.com>
Subject Error in intializing Velocity for StringResourceLoader
Date Sat, 28 Jun 2008 10:13:26 GMT

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


Mime
View raw message