title: The requested resource (/BulkAccess/Download) is not available
body: <p>I am trying to download excel file from server after clicking on a link. I have written the below JSP and Servlet code. JSP and Servlet are both in the same folder. I get the error "<code>The requested resource (/BulkAccess/Download) is not available</code>" after clicking on hyperlink to download the excel file. </p>
  
  <p>JSP Page</p>
  
  <pre><code>  &lt;body&gt;
  
    &lt;a href="Download"&gt; Sample Excel File &lt;/a&gt;
  
    &lt;/body&gt;
  </code></pre>
  
  <p>Servlet</p>
  
  <pre><code>import javax.servlet.*;
  import javax.servlet.http.*;
  import java.io.*;
  
  @SuppressWarnings("serial")
  public class Download extends HttpServlet {
      public void doGet(HttpServletRequest request,HttpServletResponse response)
              throws ServletException, IOException {
  
          String filename = "C:\\excelFile.xls";
  
  
          ServletOutputStream out = response.getOutputStream();
          FileInputStream in = new FileInputStream(filename);
  
          response.setContentType("application/vnd.ms-excel");
          response.addHeader("content-disposition",
                  "attachment; filename=" + filename);
  
          int octet;
          while((octet = in.read()) != -1)
              out.write(octet);
  
          in.close();
          out.close();
      }
  
      public void doPost(HttpServletRequest request,HttpServletResponse response)
              throws ServletException, IOException {
          doGet(request,response);
      }
  }
  </code></pre>
  
  <p>I have the mapping in web.xml. below is the code. </p>
  
  <pre><code>&lt;servlet&gt;
  &lt;servlet-name&gt;Download&lt;/servlet-name&gt;
  &lt;servlet-class&gt;com.abc.bulk.Download&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;Download&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/Download&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>