急啊~HTTP Status 500 jsp登录问题
详细错误:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
work.Loginservlet.doPost(Loginservlet.java:83)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
第 83行周围代码:
try{
if(stmt != null) {
rs = stmt.executeQuery(sql); //返回查询结果
}
}catch(SQLException e) {
e.printStackTrace();
}
try{
if(rs.next())
{
response.sendRedirect("succe.jsp");
}
else
{
response.sendRedirect("fail.jsp");
}
这行为第83行:if(rs.next())
求高手指教T T
[解决办法]
你确定rs不为null?
最好外面来个
if(rs!=null){
你的代码
}
[解决办法]