Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have login form on index.html ..and when user login then action="Login.jsp" is called
if user enter wrong username/password.
then I want that mycode show invalid username or password on index.html page


login.jsp


C#
if(ch==0)
                     {
                        System.out.println("incorrect username or password ");

                        // what code should i write here doing the above same

                     }
                     else
                     {
                         //if username and password match
                         System.out.println("logged in as "+cstmt.getString(3));
                            session.setAttribute("user",cstmt.getString(3));
                            session.setAttribute("username",cstmt.getString(4));

                     response.sendRedirect("Home.jsp");
                     }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900