当前位置: 代码迷 >> Java Web开发 >> Servlet.service() for servlet jsp threw exception,该如何解决
  详细解决方案

Servlet.service() for servlet jsp threw exception,该如何解决

热度:4260   发布时间:2016-04-10 23:36:13.0
Servlet.service() for servlet jsp threw exception
org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.left_jsp._jspService(left_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

#left.jsp 代码#
<%@ page language="java" pageEncoding="gbk"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>

<%@page import="org.sx.dto.TUser"%>
<%@page import="org.sx.dto.TRole"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
var m = "";
function menu(num){
sub = eval("sub_"+num+".style");
if(m != sub){
if(m != ""){
m.display = "none";
}
sub.display='block';
m = sub;
}else{
sub.display = "none";
m = "";
}
}
</script>
<link rel="stylesheet" type="text/css" href="images/styles.css">
    <style type="text/css">
<!--
.m1 {
font-size: 12px;
font-weight: bold;
margin-left: 60px;
text-align: center;
vertical-align: sub;
}
.sub1 {
margin-left: 40px;
}
-->
        </style>
        
        
 <%
         TUser user=(TUser)session.getAttribute("user");//youcuo 
         TRole role=(TRole)session.getAttribute("role");
         int[] a = (int[])session.getAttribute("a");
if(user==null){
    response.sendRedirect("login.jsp");

          System.out.println("接收user的值 "+user.getUserName());
          System.out.println("接收user的值 "+user.getUserRoleId());
%>      
        
        
        
        
        
        
        
        
        
        
</head>
  <body leftmargin=0   topmargin=0 bottommargin="0">
    <table border="0" width="173" height="100%" align="center" cellSpacing="0" cellPadding="0" bgcolor="#E0FBC4">
     <!-- 系统管理 -->
    
     <tr>
<td onClick="menu(0)" height="33" background="images/m1.jpg">
<font class="m1">
系统管理
</font>
</td>
</tr>

<tr bgcolor="#E0FBC4">
<td id="sub_0" style="display: none;">
<table width="80%" align="center">
 <%
     for(int i=0; i<a.length; i++){
     if(a[i]==1){
      %>
<tr>
<td height="22" onmouseover="this.style.backgroundColor='#ffffff'" onmouseout="this.style.backgroundColor=''">
<a href="adminList.do?method=queryAdminList" target="right"   class="sub1">用户管理</a>
  相关解决方案