当前位置: 代码迷 >> Java Web开发 >> javaee有关问题 严重: Servlet.service() for servlet [jsp] in context with path [/Dorm] th
  详细解决方案

javaee有关问题 严重: Servlet.service() for servlet [jsp] in context with path [/Dorm] th

热度:1521   发布时间:2016-04-14 20:42:03
javaee问题 严重: Servlet.service() for servlet [jsp] in context with path [/Dorm] th
新人求教,错误问题如下,请问如何解决?

严重: Servlet.service() for servlet [jsp] in context with path [/Dorm] threw exception [An exception occurred processing JSP page /Left.jsp at line 24

21:  <td height="5" align="center"><img src="images/ic.gif"
22:  width="1" height="1"></td>
23:  </tr>
24:  <%if(session.getAttribute("type").toString().equals("1")){%>
25:  <tr>
26:  <td height="30" align="center" background="images/left2.jpg"
27:  style="text-align: left; padding-left: 40px;"><a


Stacktrace:] with root cause
java.lang.NullPointerException
at org.apache.jsp.Left_jsp._jspService(Left_jsp.java:85)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

------解决思路----------------------
java.lang.NullPointerException  空指针异常
<%if(session.getAttribute("type").toString().equals("1")){%>
从session中获取出来的type对象可能为null,所以需要添加非空判断

<%if(null != session.getAttribute("type") && session.getAttribute("type").toString().equals("1")){%>
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!