What is the path of .vm in servlet ( Apache Velocity)
Hi All,
I have a servlet
Class testServlet extends HttpServlet
{
}
I am using apache velocity to generate some text.
But the path of .vm is not recognized
VelocityEngine ve=new Velocity();
Template template =ve.getTemplate("test.vm");
Where should i place the .vm file.
Any help is highly appreciated!!!!!
Thanks.
Re: What is the path of .vm in servlet ( Apache Velocity)
Not for sure but if you run the following: System.getProperty("user.dir");
it will give you a directory. Place the file in there and Velocity.getTemplate("index.vm"); will pick up the file in that directory. Its a work around for now as i am too looking for a way to place the .vm file within my package and have the program to get it.