-1

我收到以下错误

HTTP Status 500 -

type Exception report

message

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:548)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:471)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    ahp.CompareCriterionSlider.doGet(CompareCriterionSlider.java:35)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause

java.lang.NullPointerException
    org.apache.jsp.CompareCriterionSlider_jsp._jspService(CompareCriterionSlider_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    ahp.CompareCriterionSlider.doGet(CompareCriterionSlider.java:35)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

对于线路:dispatcher.forward(request, response);

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession session = request.getSession(true);
        session.setAttribute("criterions", CriterionRecommander.values() );
        RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/CompareCriterionSlider.jsp");
        dispatcher.forward(request, response);
    }

CompareCriterionSlider.jsp在目录里WebContent/

我试图设置断点来调试它,但是 eclipse(Version: Indigo Service Release 2) 给了我:Source not found.

在此处输入图像描述

谁投票给我一个理由?

4

1 回答 1

2

您的 JSP 抛出了一个空指针异常,您需要在 JSP 中找到导致该异常的确切代码行。
一种方法是简单地打开 jsp 的已编译 java 文件,即 CompareCriterionSlider_jsp.java:91,然后将其映射到 JSP 中的行。
一旦你这样做了,鉴于它是一个空指针,它应该很容易找出错误。

于 2013-02-15T03:59:51.783 回答