velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghushri Sankaran <raghus...@netscape.net>
Subject Re: Concern regarding template path!
Date Sat, 12 Oct 2002 22:36:03 GMT
When we tried to initialize the Velocity Engine, there was a run time 
exception saying that the velocity engine could not initialize because 
it was missing some files in the commons package and these are not 
 included in the default jar file. I downloaded the RC1 version of 1.3. 
Is that the latest one? And if possible could you please provide a 
snippet of code illustrating how to initialize the velocity engine.

Geir Magnusson Jr. wrote:

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



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