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: Using a standalone app in a servlet environment
Date Mon, 12 Jul 2004 16:39:39 GMT
Hi,

I suspect that "lib" is not actually in the class path.  (jar file in lib
are, but not lib itself).

I've had better luck with the the File resource loader.  If you initialize
the properties in code you can set this to be within your web app
automatically.

Quoting Mike Curwen of a couple weeks ago:

p.setProperty("file.resource.loader.path",
app.getRealPath("/WEB-INF/templates"));

WILL

----- Original Message ----- 
From: "Markos Charatzas" <xarm@forthnet.gr>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Monday, July 12, 2004 5:46 AM
Subject: Using a standalone app in a servlet environment


> Hi there,
>
> I'm into the following despair.
>
> I have a standalone application with the following directory structure
>
> /classes
> /resources/templates/
>
>
> a velocity.properties file resides in the /resources directory with the
> following:
>
> resource.loader = OpenseasService
>
> OpenseasService.loader.description = "Openseas Service Resource Loader"
> OpenseasService.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
>
>
> a simple class that has a template attached to it is using the path
> "/resources/templates/test.vm" for example
>
> I pack the application into a jar file retaining the directory structure
> mentioned above (of course classes dir is removed)
> and deploy it in the WEB-INF\lib of a webapp.
>
> However the resource loader is unable to locate the template in
> "/resources/templates/test.vm" within that jar.
> I assume that's since the ClasspathLoader is different since Tomcat is
> the container now.
>
> Is there a workaround in this? :(
>
> Thx in advance,
> Markos Charatzas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
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