You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by rajesh <ka...@gmail.com> on 2007/04/04 12:20:41 UTC

problem accessing velocity template using Velocity.getTemplate()

i am trying to access templet in HelloTest file which extends
VelocityServlet and in the coding i am using
try
{
context.put("name", "Velocity Test");
template = Velocity.getTemplate("hello.vm");
} catch( Exception e )
{
System.err.println("Exception caught: " + e.getMessage());
}
return template;
}
but i am recieving Unable to find resource './hello.vm' from the tomcat 6.0
server.i have saved hello.vm file in WEB-INF folder.
can u please guide me where i have been wrong,as i am very new to velocity
template language

Re: problem accessing velocity template using Velocity.getTemplate()

Posted by Will Glass-Husain <wg...@gmail.com>.
Try putting hello.vm in the main webapp folder, not WEB-INF.

WILL

On 4/4/07, rajesh <ka...@gmail.com> wrote:
>
> i am trying to access templet in HelloTest file which extends
> VelocityServlet and in the coding i am using
> try
> {
> context.put("name", "Velocity Test");
> template = Velocity.getTemplate("hello.vm");
> } catch( Exception e )
> {
> System.err.println("Exception caught: " + e.getMessage());
> }
> return template;
> }
> but i am recieving Unable to find resource './hello.vm' from the tomcat
> 6.0
> server.i have saved hello.vm file in WEB-INF folder.
> can u please guide me where i have been wrong,as i am very new to velocity
> template language
>



-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com