java密码不能为空_每次输入后都显示用户名和密码不能为空,然后密码输入错误了,他显示无此用户。顺序问题?..

String User = request.getParameter("User"); //得到登录用户名

String Pwd = request.getParameter("Pwd"); //得到登录密码

if (null == User || "".equals(User) || null == Pwd

|| "".equals(Pwd));

System.out.println("用户名和密码不能为空");

System.out.println(User);/* 输出用户名和密码 */

System.out.println(Pwd);

Dao dao = new Dao();

dao.startTransaction();

try {

Map param = new HashMap();

param.put("login_name", User);

param.put("passwd", Pwd);

Person person = (Person) dao.select(

"PersonMapper.selectPersonByUsernamePassword", param);

if (person == null) {

System.out.println("无此用户");

}

else if(!person.getPasswd().equals(Pwd)){

System.out.println("密码错误");

}

else {

System.out.println("用户校验正确");

}

} finally {

dao.endTransaction();

}

%>

展开

本文链接:https://my.lmcjl.com/post/10465.html

展开阅读全文

4 评论

留下您的评论.