-2

我的 jsp 页面上出现以下错误,但不知道在哪里查看。

     javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NullPointerException
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.jsp.layout.layout_jsp._jspService(layout_jsp.java:179)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1054)
    org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:292)
    org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:268)
    org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:329)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
    nl.kb.idm.selfservice.Servlet.process(Servlet.java:145)
    nl.kb.idm.selfservice.Servlet.doGet(Servlet.java:90)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    nl.kb.idm.selfservice.EncodingFilter.doFilter(EncodingFilter.java:42)
    nl.kb.idm.selfservice.CrossScriptingFilter.doFilter(CrossScriptingFilter.java:40)


root cause 

java.lang.NullPointerException
    org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    ...

有人可以指出我正确的方向吗?

亲切的问候,乔

4

1 回答 1

0

这些类型的错误可能很难追踪。您可以做的一件事是将整个页面包装在一个异常处理程序中,如下所示:

<%
try {
%>

<!-- Your HTML and page logic here -->

<%
} catch(Throwable t) {
    t.printStackTrace();
}
%>

确保它不会进入生产环境,因为该页面的所有异常都将进入您的标准错误,而不是您的日志。

希望有帮助!

于 2012-11-30T09:52:23.380 回答