velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: how to find vm location in a velocity application jar
Date Mon, 24 Apr 2006 04:34:09 GMT
Have you looked into the JarResourceLoader or (my favorite) the
ClasspathResourceLoader?

http://jakarta.apache.org/velocity/docs/developer-guide.html#Resource%20Loaders

WILL

On 4/23/06, Son Juhee <fount17@hotmail.com> wrote:
>
> hi,
>
> I'm developing a simple code-generator program using velocity.
> I'll distribute this as a jar (including java main- class and vm files )
> to
> developers.
> A problem is the location of vm files..
>
> generator.jar! main.java
>                     vm/ aaa.vm
>                            bbb.vm
>
> in this structure, how can I find the path of vm files?
>
> property.setProperty( "file.resource.loader.path", "../vm" );
> Velocity.init(property);
> => doesn't work.. it searches for the "where javaw executed"../vm  NOT
> INSIDE JAR!!
>
> I cannot use an absolute path, because vm files are inside jar and I don't
> even know where developers will put the jar  !!
>
> is there any way to use ../.. path to access vm files inside jar??
>
> please help.. any help will be appreciated!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message