velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qin Ding" <>
Subject Re: Please Help
Date Tue, 07 Oct 2003 18:53:05 GMT

Mailmur: Thank you for your advice.

Would you please show me how to use Classpathresourceloader? Thank you.



This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.

                      mailmur <mailmur                                                
            >              To:      Velocity Users List           
                      10/07/03 01:30           cc:                                       
                      PM                       Subject: Re: Please Help                  
                      Please respond                                                     
                      to "Velocity                                                       
                      Users List"                                                        

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

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

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

View raw message