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" <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to