velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: A strange problem of ResourceNotFound
Date Mon, 04 May 2009 14:03:18 GMT
On Sun, May 3, 2009 at 11:28 PM, Manish <prolist@gmx.net> wrote:
> Sorry for bad formatting on last one. The mail should be -
> The engine initialization code is simply this much (pretty old, actually) -
>
> VelocityEngine ve = new VelocityEngine();
>  try {
>  ve.init();
>  } catch (Exception e) {
>  throw new RuntimeException(e);
>  }
>
> Is there something I can do here?

yes.

ve.setProperty("file.resource.loader.path", systemPathToYourFiles);

or set it up to use the Webapp[Resource]Loader from VelocityTools if
your app is a webapp and you want it to be more portable and/or work
as an unexpanded WAR file.

there's plenty of documentation and old posts in the list archives on
configuring resource loaders so Velocity knows how to find your
templates.

> - Manish
>
>
>
>
>
>> Since you are just passing a Reader directly to the evaluate() method,
>> your VelocityEngine knows absolutely nothing about the path from which
>> it came.  So, how are you configuring the VelocityEngine instance you
>> are using here (ve)?  I don't see that code here.
>>
>> On Thu, Apr 30, 2009 at 5:45 AM, Manish <prolist@gmx.net> wrote:
>>>
>>> We are facing this strage problem in our code that uses standalone
>>> velocity
>>> engine. So far it did send the emails correctly from this standalone
>>> program
>>> running (this particular code doesn't reside under struts application) on
>>> our server.
>>>
>>> This is the part of teh code we use -
>>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message