How to do form based authentication? I submit my code here.

<html>
<head>
<title>Enter your name and password</title>
</head>
<body bgcolor="#999966">
<p>&nbsp;</p>
<form method="POST" action="Order.jsp">
<p><font color="#800000" size="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Enter your company  name:</font><input type="text" name="coname" size="20"></p>
<p><font color="#800000" size="5">
Enter your password:</font><input type="password" name="password" size="20"></p>
<p><input type="submit" value="Submit" name="B1"></p>
<% String cname= request.getParameter("coname");
   String cpwd= request.getParameter("password");
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   Connection c=DriverManager.getConnection("Jdbc:Odbc:emp");
   Statement s= c.createStatement();
   ResultSet r=s.executeQuery("select * from complog where Comp_name="+cname+" ");
   while(r.next())
      {
        String cpwd1 =r.getString(2);
        if(cpwd1.equals(cpwd))
          {
            response.sendRedirect("Order.jsp");
          }
      }   
%>
</form>
</body>
</html>

I used redirect here. which i feel not correct. I surfed regarding this, Have to modify webconfig.xml
How to do it?

Because you are doing this completely wrong. From front to end. See the links I gave you in your other thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.