title: java.io.FileNotFoundException: The requested resource is not available
body: <p>I need your help in finding the solution to the error which I am getting as I have tried my level best to solve the error .</p>
  
  <p>The error(which is showing in Console) is :</p>
  
  <blockquote>
    <p>SEVERE: Servlet.service() for servlet [servlet.RegisterServlet] in
    context with path [/Company_Mailer_System] threw exception
    <strong>java.io.FileNotFoundException:</strong> The requested resource [/Company_Mailer_System/header.html] is not available   at
    org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:797)
      at
    org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:454)
      at
    org.apache.catalina.servlets.DefaultServlet.doPost(DefaultServlet.java:547)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)     at
    org.apache.catalina.servlets.DefaultServlet.service(DefaultServlet.java:434)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)     at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      at
    org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:580)
      at
    org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:516)
      at servlet.RegisterServlet.doPost(RegisterServlet.java:24)  at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:660)  at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      at
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
      at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)
      at
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
      at
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)
      at
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)</p>
  </blockquote>
  
  <p>My code is as follows :</p>
  
  <pre><code>package servlet;
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @WebServlet("/RegisterServlet")
  
  public class RegisterServlet extends HttpServlet 
  {
   public void doPost(HttpServletRequest request, HttpServletResponse 
    response) throws ServletException, IOException
   {
       response.setContentType("text/html");
       PrintWriter out=response.getWriter();
  
      request.getRequestDispatcher("header.html").include(request, 
      response);      
      String name=request.getParameter("name");
      String password=request.getParameter("password");
      String email=request.getParameter("email");
      String gender=request.getParameter("gender");
      String dob=request.getParameter("dob");
      String addressLine=request.getParameter("addressLine");
      String city=request.getParameter("city");
      String state=request.getParameter("state");
      String country=request.getParameter("country");
      String contact=request.getParameter("contact");
  
  
      int status=dao.RegisterDao.save(name, email+"@cmailer.com", password, gender, dob, addressLine, city, state, country, contact);
      if(status&gt;0)
      {
          out.print("&lt;p&gt;You are successfully registered!&lt;/p&gt;");
          request.getRequestDispatcher("Login.html").include(request, response);
      }
      else
          out.print("&lt;p&gt;You are successfully not registered!&lt;/p&gt;");
      request.getRequestDispatcher("footer.html").include(request, response);     
  }}
  </code></pre>
  
  <p>The header.html file is as follow:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;style type="text/css"&gt;
  .inputform{float:left;
  width:400px;border:1px solid pink;border-radius:10px;padding:10px;
  }
  .inputform table tr td input,textarea,select{width:200px;}
  #gender1,#gender2{width:10px;}
  #submit{margin-left:100px;width:100px;} 
  #reset{width:100px;}
  .design{background-color:red;color:white;padding-left:100px;}
  &lt;/style&gt;
  &lt;body&gt;
  &lt;!-- header --&gt;
  &lt;h2&gt;Company Mailer&lt;/h2&gt;
  &lt;h3 style="background-color:red;color:red;"&gt;c&lt;/h3&gt;
  &lt;!-- body --&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank You in advance.</p>