Hi all,
when I use equals method is not working when i tried to check password from database and from textfeild both the values are same but eqals method shows error
my code is
if(strPasswordNew.equals(passwordManager.getPassword()))
My complete code for rreference
String strPasswordOld=request.getParameter("oldpassword");
String strPasswordNew=(request.getParameter("newpassword")).trim();
String strPasswordNew1=(request.getParameter("newpassword1")).trim();
if(strPasswordNew.length()!=0 && strPasswordNew.equals(strPasswordNew1)){
dataManager.getConnection();
PasswordManager passwordManager =new PasswordManager();
passwordManager=dataManager.getPassword(strUserId);
if(strPasswordNew.equals(passwordManager.getPassword())){
dataManager.changePassword(strUserId,strPasswordNew);
session.setAttribute("error", "Password Changed Successfully");
response.sendRedirect("/CMS/editdetails.jsp");
}
else{
session.setAttribute("error","Password Doesnot match with your DB");
response.sendRedirect("/CMS/editdetails.jsp");
}
}
else{
out.print("error");
session.setAttribute("error", "password mismatch");
response.sendRedirect("/CMS/editdetails.jsp");
}
}
Thanks in advance