velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Concern regarding template path!
Date Sat, 12 Oct 2002 22:31:31 GMT
On 10/12/02 3:27 PM, "Raghushri Sankaran" <raghushri@netscape.net> wrote:

> Hi All,
>       I am just starting to use Velocity. I tried using the 1.3
> version but it gave me certain compilation problems when running the
> sample program provided in the manuals. I theninstalled the 1.1 version
> and everything worked fine. My only concern now is that I am trying to
> use it with ATG Dynamo application server. Id I just initialize velocity
> and merge the template , the template file is picked up from the app
> server home. This behaviour is expected, but when I try and give a
> relative path it does not work. Here is my code:

What was the problem with 1.3?  We don't want to support 1.1...

> 
> try{
>     Properties p = new Properties();
>     p.setProperty("file.resource.loader.path","/templates");
>     Velocity.init(p);
>     VelocityContext vc = new VelocityContext();
>     vc.put("name","Superman");
>     StringWriter w = new StringWriter();
>     Velocity.mergeTemplate("t.vm",vc,w);
>     System.out.println("Template is :"+w);
>   }
>   catch(Exception e)
>   {
>     e.printStackTrace();
>   }
> 
> I get a ResourceNotFoundException even though my template t.vm is in
> <APPSERVERHOME>/templates directory. Can someone please help.
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr. 
geirm@adeptra.com                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)



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


Mime
View raw message