首页上一页 1 下一页尾页 1 条记录 1/1页
jsp数据库系统开发案例精选第4章的问题
发表在JavaWeb图书答疑
2008-04-21
是否精华
是
否
版块置顶:
是
否
<P>不能正常运行。错误提示为</P>
<H1>HTTP Status 500 - </H1>
<HR noShade SIZE=1>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>type</FONT></B> Exception report</P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>message</FONT></B> <U></U></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>description</FONT></B> <U>The server encountered an internal error () that prevented it from fulfilling this request.</U></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>exception</FONT></B> <PRE>org.apache.jasper.JasperException: Exception in JSP: /login.jsp:13
10: "username='"+username+"' and password='"+password+"'";
11: ResultSet rs=rst.getResult(str);//执行SQL语句获得结果集对象
12: session.setAttribute("isLog",new String("0"));//判断用户是否登陆,当isLog的属性为0时,说明用户并没有登陆
13: if(!rs.next())//结果集没有找到所要查找的行
14: {
15: out.println("<script language='javascript'>alert('用户名或密码错误');"+
16: "parent.location.href='login.html';</script>");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
</PRE>
<P></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>root cause</FONT></B> <PRE>java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(login_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
</PRE>
<P></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>note</FONT></B> <U>The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.</U></P>
<H1>HTTP Status 500 - </H1>
<HR noShade SIZE=1>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>type</FONT></B> Exception report</P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>message</FONT></B> <U></U></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>description</FONT></B> <U>The server encountered an internal error () that prevented it from fulfilling this request.</U></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>exception</FONT></B> <PRE>org.apache.jasper.JasperException: Exception in JSP: /login.jsp:13
10: "username='"+username+"' and password='"+password+"'";
11: ResultSet rs=rst.getResult(str);//执行SQL语句获得结果集对象
12: session.setAttribute("isLog",new String("0"));//判断用户是否登陆,当isLog的属性为0时,说明用户并没有登陆
13: if(!rs.next())//结果集没有找到所要查找的行
14: {
15: out.println("<script language='javascript'>alert('用户名或密码错误');"+
16: "parent.location.href='login.html';</script>");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
</PRE>
<P></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>root cause</FONT></B> <PRE>java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(login_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
</PRE>
<P></P>
<P><B><FONT style="BACKGROUND-COLOR: #525d76" color=#ffffff>note</FONT></B> <U>The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.</U></P>