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("oldp ass");
String newpass = request.getParameter("newp ass");
String confirmpass = request.getParameter("conf irmpass");
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("erro r", "yes");
RequestDispatcher rd = request.getRequestDispatch er("/passw ord.jsp");
rd.forward(request, response);
}
..................
String oldpass = request.getParameter("oldp
String newpass = request.getParameter("newp
String confirmpass = request.getParameter("conf
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("erro
RequestDispatcher rd = request.getRequestDispatch
rd.forward(request, response);
}
..................
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there anyone can help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER