Re: Resource from a jar file

2009-06-15 Thread Nathan Bubna
Yes, but at some point, many Velocity users will "ship" an app with "finished" templates that the customer won't modify. At that time, it can make a lot of sense to just keep your templates in the classpath or a non-classpath jar. Guessing from user examples and questions, the ClasspathResourceLo

Re: Resource from a jar file

2009-06-15 Thread Mark Fenbers
Amidst this dialog, the thought occurred to me that templates are made to be customized (or what would be the point of Velocity?), and so I realized that these template really don't belong in a Jar file anyway. If they were, people who know little about Java would have to un-jar the templates,

Re: Resource from a jar file

2009-06-15 Thread Nathan Bubna
Can you put your jar in the classpath and use the ClasspathResourceLoader instead of going through the file system? I've never used the JarResourceLoader, and i haven't really got time to dig in and see why it isn't working for you right now... On Sun, Jun 14, 2009 at 11:21 AM, Mark Fenbers wrote:

Re: Resource from a jar file

2009-06-14 Thread Mark Fenbers
Nathan Bubna wrote: You can configure multiple resource loaders in a lookup order. resource.loader=jar,file,whatever jar.resource.loader.class = ... file.resource.loader.class = ... whatever.resource.loader.class = ... if Velocity can't find it via the jar one, it'll ask the file one, then the

Re: Resource from a jar file

2009-06-13 Thread Nathan Bubna
On Sat, Jun 13, 2009 at 6:48 PM, Mark Fenbers wrote: > Nathan Bubna wrote: >> >> I think org.apache.velocity.runtime.resource.loader.JarResourceLoader >> was created to help with such situations. >> >> > > OK, I read up on JarResourceLoader() and put the appropriate resource loader > entries into t

Re: Resource from a jar file

2009-06-13 Thread Mark Fenbers
Nathan Bubna wrote: I think org.apache.velocity.runtime.resource.loader.JarResourceLoader was created to help with such situations. OK, I read up on JarResourceLoader() and put the appropriate resource loader entries into the velocity.properties file, but now I have a new problem in that if

Re: Resource from a jar file

2009-06-13 Thread Nathan Bubna
I think org.apache.velocity.runtime.resource.loader.JarResourceLoader was created to help with such situations. On Sat, Jun 13, 2009 at 4:56 PM, Mark Fenbers wrote: > I'm having some trouble with mergeTemplate() in that it seems to be unable > to open a template file if it is packaged in a jar fil

Resource from a jar file

2009-06-13 Thread Mark Fenbers
I'm having some trouble with mergeTemplate() in that it seems to be unable to open a template file if it is packaged in a jar file. In my Java code, I use getResource("resources/velocity.template").getFile() [from the "Class" object] to expand the relative location to a full URL. This is for