Results 1 to 2 of 2
  1. #1
    jdra is offline Member
    Join Date
    Mar 2011
    Rep Power

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


  2. #2
    SigmaSquared is offline Member
    Join Date
    Dec 2011
    Rep Power

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

Similar Threads

  1. Apache 1.3 Servlet not found
    By teckygamer in forum Java Servlet
    Replies: 1
    Last Post: 09-06-2010, 02:16 AM
  2. Spring, XMLBeans, Apache Velocity
    By emranrao in forum Advanced Java
    Replies: 0
    Last Post: 05-31-2010, 04:59 PM
  3. Replies: 1
    Last Post: 01-28-2010, 05:45 PM
  4. Apache Velocity template file and output locations
    By mjwoodford in forum New To Java
    Replies: 1
    Last Post: 10-05-2009, 03:59 PM
  5. Replies: 1
    Last Post: 12-02-2008, 01:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts