象这样:
if (rs.next()) {
response.sendRedirect("success.jsp");
} else {
response.sendRedirect("error.jsp");
}
if (rs.next()) {
response.sendRedirect("success.jsp");
} else {
response.sendRedirect("error.jsp");
}
解决方案 »
- 为什么spring的注解得到值为null呢
- 请教个一直困扰我很久的问题,页面布局,路过的来看看吧!
- 如何实现图片和文字一起的走马灯
- 怎样用xloadtree实现无限级目录树(数据库取节点)
- jquery easyui datagrid title乱码的问题
- 哪位大侠有jfreechart-demo中的源代码啊~~~~
- 关于javabean封装数据库操作的问题!
- jsp页面在ie的左下角出现该望页有错误。
- jsp中如何限制校外ip的登陆,送高分,再线等后
- struts标签使用场合讨论!
- 求救!!!tomcat中无法调用javabean!!给分!!!
- 如何在Jbuilder自带的Tomcat中配置JDBC,使WebApp工程中的jsp可以调用JDBC?
<script>
window.location="error.jsp";
</script>
String sql = "select * from user where id='"+name+"' and password='"+password+"'";
rs = qu.executeQuery(sql);
String dir_file="error.jsp";
while(rs.next)
{
String username = rs.getString(1); //第一列为用户名
if(username==null)
{
dir_file="success.jsp";
}
}
response.sendRedirect(dir_file);
如果输入错误的用户名和密码 rs是null的逻辑上错误了吧 应该
if(rs!=null){
response.sendRedirect("success.jsp");
}else{
response.sendRedirect("error.jsp");}祝你好运