按照老师的代码,出现空指针异常,怎么办?

HTTP Status 500 - java.lang.NumberFormatException: null

type Exception report

message java.lang.NumberFormatException: null

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

exception

org.apache.jasper.JasperException: java.lang.NumberFormatException: null
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:555)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.NumberFormatException: null
	java.lang.Integer.parseInt(Unknown Source)
	java.lang.Integer.parseInt(Unknown Source)
	org.apache.jsp.details_jsp._jspService(details_jsp.java:174)
	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:438)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	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.0.28 logs.


完美幸福0
浏览 2652回答 2
2回答

冰山点水

这是数字格式异常,不是空指针异常,应该是在转型的时候出的问题,比如数字转字符串或者字符串转数字时候出了问题。仔细检查相应部分代码。

大咪

这是哪一个章节的课程?我帮你看看
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java