title: The requested resource is not available. JSP program error
body: <p>I am trying my forst jsp login program. It shows the login page correctly, but when I submit it gives the error:</p>
  
  <p>HTTP Status 404 - /UserPass/username</p>
  
  <p>type Status report</p>
  
  <p>message /UserPass/username</p>
  
  <p>description The requested resource is not available.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>username.java
  
  package sid;
  
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class username extends HttpServlet{
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) 
      {
          response.setContentType("text/html");
  
          String user=request.getParameter("username");
          String pass=request.getParameter("password");
  
          if(user.equals("sid") &amp;&amp; pass.equals("hello"))
          {
              System.out.println("Welcome");
          }
          else
          {
              System.out.println("Invalid username or password");
          }
      }
  }
  </code></pre>
  
  <p>user.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Login Page&lt;/h1&gt; 
  &lt;center&gt; 
  
  &lt;form action="username" method="GET"&gt; &lt;br/&gt;
  User :&lt;input type="text" name="username"&gt; &lt;br/&gt;
  Pass :&lt;input type="password" name="password"&gt; 
  &lt;br/&gt;&lt;input type="submit" value="Submit"&gt; &lt;/form&gt; 
  &lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;web-app&gt;
      &lt;servlet&gt;
      &lt;servlet-name&gt;login&lt;/servlet-name&gt;
      &lt;servlet-class&gt;sid.username&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;login&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/username/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My user.jsp code is in WebContect, and my web.xml is in WebContent/WEB-INF/lib.
  I am using Eclipse Indigo SR2 and Apache Tomcat.</p>