velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Son Juhee" <foun...@hotmail.com>
Subject Re: how to find vm location in a velocity application jar
Date Mon, 24 Apr 2006 06:12:51 GMT

Thanks,  Will!
I missed that part in the guide!!
I solved the problem by this:

            conf.setProperty( "resource.loader", "jar" );
            conf.setProperty( "jar.resource.loader.class", 
"org.apache.velocity.runtime.resource.loader.JarResourceLoader" );
            conf.setProperty( "jar.resource.loader.path", 
"jar:file:C:/myproject/lib/generator.jar" );


>From: "Will Glass-Husain" <wglass@forio.com>
>Reply-To: "Velocity Users List" <velocity-user@jakarta.apache.org>
>To: "Velocity Users List" <velocity-user@jakarta.apache.org>
>Subject: Re: how to find vm location in a velocity application jar
>Date: Sun, 23 Apr 2006 21:34:09 -0700
>
>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



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


Mime
View raw message