velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mailmur <mail...@yahoo.com>
Subject Re: Please Help
Date Wed, 08 Oct 2003 07:31:30 GMT
See DevGuide.
http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20Resource%20Loaders

resource.loader = class
class.resource.loader.description = Velocity Classpath
Resource Loader
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

> Mailmur: Thank you for your advice.
> 
> Would you please show me how to use
> Classpathresourceloader? Thank you.
> 
> qd


> 1) Hardcode rootpaths for FileResourceLoader
> No good for servlet deployment
> 
> 2) Tweak .path value before initing Velocity
> Use servletcontext.getRealpath() to construct the
> fullpath at runtime, load velocity.properties,
> modify
> .path value, init velocity engine
> 
> 3) Use Classpathresourceloader
> This will use classloader, so you can keep templates
> under the webapp folder structure.
> 
> I've chosen to use option 2 in my environment.
> Fileresourceloader have a better cachereloading
> support than classpathloader.
> 
> >>>>>>
>
file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoadr
> 
> >
> > file.resource.loader.path=longlegs/core/template
> >
> > The package structure:
> > longlegs is the root of the package. Or the top
> > folder in the jar.  The vm
> > file is in longlegs/core/template/status_report.vm
> >
> > When I issue ve.getTemplate("status_report.vm"), I
> > got resource not find:
> > "status_report.vm".

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.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