After checking the database the incorrect password should be displayed on the same login page. I have used servlet and forwarded that to the login page but i couldn't add the message "incorrect password".
RequestDispatcher rd = getServletContext().getRequestDispatcher("/register.jsp");
if(dbpwd.equals(null)) {
pw.println("Not a registered user!!! sign up......");
rd.forward(req,res);
}
In tha above snippet how to print the "Not a registered user sign up......" on the login page.