else语句

else语句
是登录的判断过程,主要代码如下:
alert("用户名不能为空!");
window.location.href="login.jsp";
alert("请填写密码!");
window.location.href="login.jsp";
alert("用户名不存在!");
window.location.href="login.jsp";
alert("密码错误!请重新输入");
window.location.href="login.jsp";
alert("登录成功!下面转入首页");
window.location.href="main.jsp";
前面三个判断都是对的,但最后两个,无论密码输入正确与否,都显示“密码输入错误”,这是怎么回事?
其他人气:219 ℃时间:2020-06-18 20:02:06
优质解答
rs.getString(3)==password
改成rs.getString(3).equals(password)
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版