title: RequestDispatcher.include(...) appends servlet's package name
body: <p>I have an index.jsp page which uploads an image. On submit it goes to a servlet Upload.java. In the servlet I am checking if the extension in of image("jpg","png",etc) and forwards to new jsp page else it shows an error message and includes the same index.jsp page.</p>
  
  <p>My servlet is a package named "servlets".</p>
  
  <p>If I select an image then it is working properly. But if I select any file other than image then it shows the error with the index.jsp page as intended. Till now it works fine but if I upload any file even image from here, the server complains.</p>
  
  <p>Here is how I am including the index.jsp page in UploadServlet.java servlet.</p>
  
  <pre><code>out.println("This type of file is not allowed. Please select an image.");
  RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp");
  dispatcher.include(request, response);
  </code></pre>
  
  <p>Here is the error from the server when I try to upload the image second time.</p>
  
  <pre><code>HTTP Status 404 - /UploadImage/servlets/servlets/UploadServlet
  </code></pre>
  
  <hr>
  
  <pre><code>type Status report
  
  message /UploadImage/servlets/servlets/UploadServlet
  
  description The requested resource (/CropImage/servlets/servlets/UploadServlet) is not available.
  </code></pre>
  
  <hr>
  
  <pre><code>Apache Tomcat/6.0.13
  </code></pre>
  
  <p>It is appending the servlet's package name to the url.</p>
  
  <p>How to solve this problem?</p>