In my web app which uses servlets and hibernate. I need to authenticate a Customer who enters a password.
If he is already in database, I need to check if his password matches that of the record in db.For a new Customer, I want to take a password and create a record for him. I tried to do it this way for the scenarios.
现有客户进入电子邮件 地址和密码
String email = req.getParameter("emailAddress");
String password = req.getParameter("password");
Customer cust = dao.findByEmailAddress(email);
现在,我如何检查这个黄色物体是否与密码有关,是否与用户的相匹配? 曼宁的藏书实例将密码作为客户阶层的长处。 这是一种好的想法吗? 如何储存在数据库中?
在使用秘密时,如何处理这一问题? 我听到有人提到,传闻像过去一样。 但我不相信我能怎样做。
Can someone tell me how I can tackle this?