Link to home
Start Free TrialLog in
Avatar of YvonneYap
YvonneYap

asked on

Change password using jsp and servlet

In servlet page, i am getting the input value type by the user from the jsp
String oldpass = request.getParameter("oldpass");
String newpass = request.getParameter("newpass");
String confirmpass = request.getParameter("confirmpass");

Now the problem come, i want to use the if statement to tell if the newpass(which is the user key in for new password) is not the same as the confirmpass(which the user key in for the confirm password) then there will be error ...

below is my coding, how am i going to add into this if statement???

 if (oldpass.equals("") || newpass.equals("") || confirmpass.equals("") ){
            // login failed
      request.setAttribute("error", "yes");      
RequestDispatcher rd = request.getRequestDispatcher("/password.jsp");
      rd.forward(request, response);
            }
..................




ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YvonneYap
YvonneYap

ASKER

em.... i mean if the newpass is not equal to comfirmpass then there will be error.
Is there anyone can help
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial