velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Brisson <cla...@renegat.net>
Subject Re: Mixing Jar and ClassResourceLoader
Date Sat, 08 Mar 2008 08:12:58 GMT
Please try to summerize your problem in a single mail...

This part of your velocity.properties looks rather strange to me:

> class.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.JarResourceLoader

It's probably a typo, it should refer to the classpath resource loader.

Otherwise, take a look at the logs, the resource loader is quite verbose
when it doesn't find a file - if it still doesn't work, please include
the portion of the log in your mail.


  Claude

Le samedi 08 mars 2008 à 14:14 +0700, Frans Thamura a écrit :
> hi there
> 
> i try to make a velocity.propierties
> 
> ----- from developer guid of velocity
> *ClasspathResourceLoader :* This loader gets resources from the classloader.
> In general, this means that the ClasspathResourceLoader will load templates
> placed in the classpath (in jars, for example) While the classpath is a
> source of great pain and suffering in general, it is a very useful mechanism
> when working on a Servlet Spec 2.2 (or newer) compliant servlet runner.
> Tomcat <http://jakarta.apache.org/tomcat/> is an example of such. *To use
> this loader effectively, all you must do is jar your templates, and put that
> jar into the WEB-INF/lib directory of your webapp. There are no
> configuration options to worry about, *nor is the absolute vs. relative path
> an issue, as it is with Jar and File resource loaders. Again, please note
> that the ClasspathResourceLoader is not only for use with a servlet
> container, but can be used in any application context.
> ----
> 
> and i want to mixed both the class and jar, and i use this syntax
> 
> anyone can help me to see it, because i think my syntax is right, but it is
> not working
> 
> i remove the jarResourceoader, still cannot read the jar template
> 
> any help is appreciated...
> 
> F
> 
> 
> # Any property that is not listed here will have it's default
> # value used.  The default values are located in :
> #  *  src/java/org/apache/velocity/runtime/default/velocity.defaults
> #  *  http://jakarta.apache.org/velocity/developer-guide.html
> #
> 
> runtime.log = ./velocity.log
> runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
> 
> # Velocity Macro libraries.
> velocimacro.library = action-default.vm
> resource.loader=jar, class
> class.resource.loader.description = Velocity Classpath Resource Loader
> class.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.JarResourceLoader
> #ClasspathResourceLoader
> class.resource.loader.cache = false
> class.resource.loader.modificationCheckInterval=2
> class.resource.loader.path=view
> 
> jar.resource.loader.description = Velocity Jar Resource Loader
> jar.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.JarResourceLoader
> #jar.resource.loader.path = jar:file:/cimande-1.3.jar
> 
> file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
> file.resource.loader.path=/WEB-INF/views
> file.resource.loader.cache=true
> file.resource.loader.modificationCheckInterval=2


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message