关于
空指针错误的请教
报错的信息如下:
description The server encountered an internal error (
An exception occurred processing JSP page /menu_advertisement_info_1.jsp at line 88 85: 86: 87: <% 88: for(int i=0;i<adinfos.size();i++){ 89: AdInfo adinfo = (AdInfo)adinfos.get(i); 90: %> 91: <tr class="Label1_text_blue" id="row1" align="center"> Stacktrace:) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /menu_advertisement_info_1.jsp at line 88
85:
86:
87: <%
88: for(int i=0;i<adinfos.size();i++){
89: AdInfo adinfo = (AdInfo)adinfos.get(i);
90: %>
91: <tr class="Label1_text_blue" id="row1" align="center">
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException org.apache.jsp.menu_005fadvertisement_005finfo_005f1_jsp._jspService(menu_005fadvertisement_005finfo_005f1_jsp.java:154)
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:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.
出错的JSP页面如下 , 两天了一直没找出问题所在,麻烦大虾们帮忙看看:
XML code
<%@page import="java.sql.ResultSet"%>
<%@page import="com.bean.hotel.service.AdInfoService"%>
<%@page import="com.bean.hotel.dto.AdInfo"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>广告信息管理</title>
<style type="text/css">
@import url("style/style.css");
@import url("style/calendar.css");
</style>
</head>
<body>
<form name="form1" method="post">
<table width="90%"><tr>
<td width="499">
<img src="images/icon_point.gif" width="12" height="12"><a class="title">酒店广告信息-管理</a></td>
<td colspan="2" align="right"><img src="images/icon_point.gif" width="12" height="12"><a class="t