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:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
com.edu.hbcit.Bean.SqlBean.getSearch(SqlBean.java:183)
org.apache.jsp.SearchList_jsp._jspService(SearchList_jsp.java:95)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
页面代码:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>显示记录</title>
</head>
<body>
<center >
<font color=red size=72>运动会组别如下:</font>
<hr>
<table border=1 bgColor="#ffffff" width="500px" height="100px">
<tr>
<td>ID</td>
<td>组别</td>
<td>类型</td>
<td><center>操作</center></td>
</tr>
<jsp:useBean id="sBean"class="com.edu.hbcit.Bean.SqlBean"/>
<jsp:useBean id="jBean" class="com.edu.hbcit.Bean.JavaBean"/>
<%
String sql ="select * from t_group order by id";
java.util.List list =sBean.getSearch(sql);
for(java.util.Iterator it =list.iterator();it.hasNext();)
{
//获取一个JavaBean对象
jBean =(com.edu.hbcit.Bean.JavaBean)it.next();
%>
<tr>
<td><%=jBean.getId() %></td>
<td><%=jBean.getName() %></td>
<td><%=jBean.getType() %></td>
<td>
<a href="Insert.jsp">增加</a>
<a href="Delete.java?id=<%=jBean.getId()%>">删除</a>
<a href="SearchById.java?id=<%=jBean.getId()%>">修改</a>
</td>
</tr>
<% }%>
</table>
</center>
</body>
</html>
sBean.getSearch(sql);
sBean好像没定义,也没有引用包可能,你自己查一下,产生的NULL