title: Why I got the error "HTTP method post is not supported by this URL"?
body: <p>I am developing a Login app using servlets in eclipse.
  I created one login form which contains two text fields(for entering username and password) and one login button. When user click this button it redirects to LoginCheck page where it login details are checked. But problem is that when I run this project I got error : HTTP Status 405 - HTTP method POST is not supported by this URL. What is the problem I did''t understand.</p>
  
  <p>Below is my code for <code>LoginPage</code>:</p>
  
  <pre><code>public class LoginPage extends HttpServlet {
     protected void doGet(HttpServletRequest request, HttpServletResponse   response) throws ServletException, IOException {
     response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println("&lt;form method='post' actin='LoginCheck'&gt;");
              out.println("Username: &lt;input type='text' name='username'&gt;");
              out.println("Password: &lt;input type='password' name='password'&gt;");
              out.println("&lt;input type='submit' value='login'&gt;");
          out.println("&lt;/form&gt;");
      }
  }
  </code></pre>
  
  <p>Now when user click Login button it have to go on the <code>LoginCheck</code> page code for this page is as follows:</p>
  
  <pre><code>public class LoginCheck extends HttpServlet {
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println("&lt;h3&gt;Checking login details...&lt;/h3&gt;");
      }
  }
  </code></pre>
  
  <p>and here it gives problem.</p>
  
  <p>This is the XML file:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"&gt;
    &lt;display-name&gt;LoginApp&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;LoginPage&lt;/servlet-name&gt;
      &lt;servlet-class&gt;LoginPage&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;LoginPage&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/LoginPage&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;LoginCheck&lt;/servlet-name&gt;
      &lt;servlet-class&gt;LoginCheck&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;LoginCheck&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/LoginCheck&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>