title: java.lang.IllegalArgumentException: Path designGoal.jsp does not start with a "/" character
body: <p>I am writing a very simple web application using servlets and JSP, in Eclipse. The server is Tomcat v7.0. Java version is 1.8.0_60. Below is my servlet code, written in file named <code>DesignGoal.java</code></p>
  
  <pre><code>package com.example;
  
  import java.io.IOException;
  import java.util.ArrayList;
  
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebInitParam;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @WebServlet(
      urlPatterns = "/DesignGoal",
      initParams = {
              @WebInitParam(name="text",value=" extreme knitting " )
      }
  )
  public class DesignGoal extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          RequestDispatcher view = getServletContext().getRequestDispatcher("/designGoal.jsp");
          view.forward(request, response);
      }
  
  }
  </code></pre>
  
  <p>And this is my file <code>designGoal.jsp</code>:</p>
  
  <pre><code>&lt;%@page import="java.util.ArrayList"%&gt;
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1"%&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"&gt; 
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Insert title here&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      Hello!
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But when I run the file <code>DesignGoal.java</code>, I get the following error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Path designGoal.jsp does not start with a "/" character
  </code></pre>
  
  <p>Can someone please tell me why I get this error, even when the string in <code>getRequestDispatcher()</code> starts with <code>/</code>, and the path that I have added is relative to the root of the Project.</p>