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<
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 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
> flexibility/portability... This approach works fine when *not* running my
> app from a Jar file because the file name expands to a simple path,
> something like: "/home/mark/resources/velocity.template" whereas when run
> from a Jar file, it expands to something like:
> "file:/home/mark/MyApp.jar!/resources/velocity.template", and thus
> mergeTemplate doesn't like this format... probably the "file:" or the "!"
> throw it off.
>
> I'm not sure how to get past this hurdle. Any ideas?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
user-unsubscribe@...
> For additional commands, e-mail:
user-help@...
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
user-unsubscribe@...
For additional commands, e-mail:
user-help@...