向大侠们求救!!! 想要显示jsp页面时出现HTTP Status 500 - An exception occurred processing JSP page

错误描述:

 

HTTP Status 500 - An exception occurred processing JSP page /main.jsp at line 23

 


 

type Exception report

message An exception occurred processing JSP page /main.jsp at line 23

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /main.jsp at line 23

20:   				
21:   			<% 
22:   				ArrayList al=(ArrayList)session.getAttribute("al");
23:  				Iterator iter=al.iterator();
24:   
25:   				while(iter.hasNext()){
26:   					LyTable ly=(LyTable)iter.next();


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(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:728)

root cause

java.lang.NullPointerException
	org.apache.jsp.main_jsp._jspService(main_jsp.java:88)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	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:728)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.

 


 

Apache Tomcat/7.0.42

代码:

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="model.LyTable" %>
<%@ page import="db.DB" %>

<html>
  <head>
    <title>留言板信息</title>
   
  </head>
 
  <body  bgcolor="#E3E3E3">
    <form action="liuyan.jsp" method="post">
     <table border="1">
      <caption>所有留言信息</caption>
      <tr><th>留言人姓名</th>
          <th>留言标题</th>
       <th>留言内容</th>
      
      </tr>
      
     <%
      ArrayList al=(ArrayList)session.getAttribute("al");
     Iterator iter=al.iterator();
 
      while(iter.hasNext()){
       LyTable ly=(LyTable)iter.next();
     
      %>
     
        <tr>
         <td><%= new DB().getUserName(ly.getUserId()) %></td>
         <td><%=ly.getDate().toString() %></td>
         <td><%= ly.getTitle() %></td>
         <td><%=ly.getContent() %></td>
        </tr>
     
      <%
       }
     
       %>
     
     </table>
     <input type="submit" value="留言"/>
    
    
    
    
    </form>
   
  </body>
</html>

 

 

附加:根据提示显示23行有错,怎么就找不出呢!!!

 

 

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页