title: JSP Servlet requested resource () is not available
body: <p>when I try I submit my form to be handled by the servlet the browser indicates that the requested resource is not available with a HTTP 404 error. The URL looks like:</p>
  
  <pre><code>http://localhost:8080/Website/DateSearchServlet
  </code></pre>
  
  <p>My XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;DateSearchServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;DB.DateSearchServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;DateSearchServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Search/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  </code></pre>
  
  <p></p>
  
  <p>To call the servlet i am using this simple form:</p>
  
  <pre><code>&lt;form name="dateSearch" action="DateSearchServlet" method="post"&gt;
      &lt;label for="from"&gt;Date From&lt;/label&gt;
      &lt;input type="text" id="from" name="from" /&gt;
      &lt;label for="to"&gt;Date To&lt;/label&gt;
      &lt;input type="text" id="to" name="to" /&gt;
      &lt;input type="submit" id="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And finally this is the servlet:</p>
  
  <pre><code>@WebServlet(name = "DateSearchServlet", urlPatterns = {"/Search"})
  public class DateSearchServlet extends HttpServlet {
  
  DatabaseConnector dataManager;
  boolean dbOK = false;
  HomeList homes = new HomeList();
  
  @Override
  public void init() {
      dataManager = new DatabaseConnector();
  }
  
  @Override
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      String dateFrom = request.getParameter("from");
      String dateTo = request.getParameter("to");
  
      if (dateFrom == null || dateTo == null) {
          dbOK = false;
      } else {
          dbOK = true;
      }//end if
  
      request.setAttribute("homeList", null);
  
      if (dbOK) {
          homes = dataManager.getPropertiesSearch(dateFrom, dateTo);
          request.setAttribute("homeList", homes);
          request.getRequestDispatcher("bookings.jsp").forward(request, response);
      } else {
          System.out.println("DBNOTOK");
          //error...
      }
  }
  }
  </code></pre>
  
  <p>Thanks</p>