问答详情
源自:8-8 使用Cookie实现保存商品浏览记录

detail.jsp里为什么抛出空指针异常了?求解? HTTP Status 500 - java.lang.NullPointerException

HTTP Status 500 - java.lang.NullPointerException

type Exception report

message java.lang.NullPointerException

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.NullPointerException
org.apache.jsp.details_jsp._jspService(details_jsp.java:241)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.5.5 logs.

Apache Tomcat/8.5.5


提问者:笑李藏刀 2016-10-23 11:24

个回答

  • sakura酱
    2016-10-25 13:06:53

    你还是把代码贴上来吧,这只能看出你details241行有错,我觉得肯定是你哪不细心写错了,看不见代码谁知道你什么错。。

  • 笑李藏刀
    2016-10-23 19:05:23

    可以连接呀

  • 好困可是还是要敲代码
    2016-10-23 12:02:14

    加一下jar包看看,先用数据库连接类的main函数测试下数据库能不能连接