title: How to configure the web.xml file?
body: <p>I have created login page in servlet:</p>
  
  <pre><code>public class dologin extends HttpServlet
  {
      static Connection con;
      static String query =null;
      static ResultSet rs;
      static PreparedStatement pstmt;
  
      String user=null;
      String passwd = null ;
  
      public void init(ServletConfig sc)
      {
          try
          {
              super.init(sc);
              /*Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              System.out.println("class loaded ... ");
              con=DriverManager.getConnection("jdbc:odbc:Odbc_mailing");
              System.out.println("connected ... ");
              st=con.createStatement();
              System.out.println("stmt created ... ");*/
  
  
  
  
          }
          catch(Exception e)
          {
             e.printStackTrace();
          }
      }
  
      public void service(HttpServletRequest hreq ,HttpServletResponse hrep)
      {
          boolean flag=false;
          try
          {
  
              String s1=hreq.getParameter("smid");
              String s2=hreq.getParameter("smpw");
              System.out.println("s1 : "+ s1+"s2 : "+s2);
              Cookie logincook=new Cookie("logincook",s1);
              Cookie pwdcook=new Cookie("pwdcook",s2);
              hrep.addCookie(logincook);
              hrep.addCookie(pwdcook);
              System.out.println("logincook :"+ logincook);
              System.out.println("pwd:"+ pwdcook);
              ServletOutputStream sos = hrep.getOutputStream();
               String query="select *  from login where username=?";
  
              con=DBConnection.getConnection();
              pstmt=con.prepareStatement(query);
              pstmt.setString(1, s1); 
  
              rs=pstmt.executeQuery();  //fname,pass1
              System.out.println("query executed ... rs "+rs);
              while(rs.next())
              {
                  System.out.println("in while loop");
              //  user=rs.getString(1);
                  //passwd=rs.getString(2);
                  System.out.println("user : "+ user + "passwd : "+passwd);
                  if((user.equals(s1))&amp;&amp;(passwd.equals(s2)))
                  {
                      flag=true;
                      break;
  
                  }
              }
          System.out.println("Aft while loop flag : "+ flag);
          if (flag==false)
              {
                  sos.println("&lt;h3&gt; You are an invalid user &lt;/h3&gt;");
                  hrep.setHeader("Refresh", "2 URL=/supermail/index.html");
              }
          if(flag==true){
                  hrep.sendRedirect("/supermail/inbox.html");
              }
          flag = false;
         }
         catch(Exception ex)
         {
             ex.printStackTrace();
             }
  
         }
      }
  </code></pre>
  
  <p>and login.html is:</p>
  
  <pre><code>&lt;form action="dologin" namw="dologin"&gt;
  Username:&lt;input type="text" name="usename"&gt;
  Paswword:&lt;input type="text" name="pass"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have configured the web.xml like:</p>
  
  <pre><code>&lt;web-app&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;dologin&lt;/servlet-name&gt;
          &lt;servlet-class&gt;dologin&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dologin&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/dologin&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I am using myeclipse IDE if run the I am getting this error like supermMail is not available super mail is my project name.please help me with this.</p>