flybamboo
2015-08-02 14:24
采纳率: 100%
浏览 1.5k
已采纳

求问 java为什么空指针异常

type Exception report

message

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

exception

org.apache.jasper.JasperException: Exception in JSP: /select.jsp:36

33:

鐢佃瘽
34:
35: <%
36: for(int i = 0;i < rsList.size();i++){
37: Map rsMap = rsList.get(i);
38: System.out.println("椹笂瑕佸惊鐜簡");
39: %>

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException
org.apache.jsp.select_jsp._jspService(select_jsp.java:82)
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:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • fanst_ 2015-08-02 16:01
    已采纳

    rsList为null吧,可以在for循环前打句日志看看。

    点赞 打赏 评论
  • 馥影 2015-08-02 14:31

    是不是rsList里没内容或者下标错误了?

    点赞 打赏 评论
  • 暖风。 2015-09-02 02:52

    空指针异常,一般都是无效的引用。

    点赞 打赏 评论

相关推荐 更多相似问题