title: getServletContext().getRealPath("/") return wrong path
body: <p>Background:
  I want to learn the web development by using Velocity and servlet. I use the <code>getServletContext().getRealPath("/")</code> to find the path of WEB-INF and the .vm file that is stored in /WEB-INF/templates/;</p>
  
  <p>but the path return is : </p>
  
  <pre><code>E:\javaWorkSpcae\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\NewVelocity\templates\
  </code></pre>
  
  <p>what i want is : </p>
  
  <pre><code>E:\javaWorkSpcae\NewVelocity\WebContent\WEB-INF\templates\hello.vm
  </code></pre>
  
  <p>I use the <code>velocity-tools-1.4, tomcat1.7, jdk1.7</code></p>
  
  <p>the code i use is:</p>
  
  <pre><code>package velocityHandler;
  
  import java.util.Properties;
  import java.util.Vector;
  
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.velocity.Template;
  import org.apache.velocity.app.Velocity;
  import org.apache.velocity.app.VelocityEngine;
  import org.apache.velocity.context.Context;
  import org.apache.velocity.tools.view.servlet.VelocityViewServlet;
  
   public class HelloHandler extends VelocityViewServlet{
        private static final long serialVersionUID = 1L;
         private VelocityEngine velo;  
  
      @Override
      public void init() throws ServletException{  
  
             //velocity引擎对象                  
         velo = new VelocityEngine(); 
  
         //设置vm模板的装载路径
         Properties prop = new Properties();
         String path = this.getServletContext().getRealPath("/");
         prop.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, path + "templates");
  
         System.out.println(path + "templates/");
  
         try {
            //初始化设置，下面用到getTemplate("*.vm")输出时
            //一定要调用velo对象去做,即velo.getTemplate("*.vm")
            velo.init(prop);
           } catch (Exception e1) {
            e1.printStackTrace();
           }
      }
  
      @SuppressWarnings("unchecked")
      @Override
      protected Template handleRequest(HttpServletRequest request,
                      HttpServletResponse response, Context ctx) throws Exception{
  
              String p1 = "Hoffman";
              String p2 = "Song";
              @SuppressWarnings("rawtypes")
              Vector personList = new Vector();
              personList.addElement(p1);
              personList.addElement(p2);
              ctx.put("theList", personList); //将模板数据 list放置到上下文环境context中
  
              Template template = velo.getTemplate("hello.vm");
              return template;
      }
  }
  </code></pre>
  
  <p>who can give me a simple about servlet and velocity, I can not find good example in internet. </p>