2 qq863017854 QQ863017854 于 2016.04.26 14:00 提问

关于jsp用session传递list 在另一页面获取并遍历输出list

如题

 List<shuxing> list = new ArrayList<shuxing>();
   shuxing s=new shuxing();
       while(rs.next()){
        s.setsShopName(rs.getString("sShopName"));
        s.setiNumbHj(rs.getString("iNumbHj"));
        s.setrMoneyHj(rs.getString("rMoneyHj"));
        list.add(s);
       }
       session.setAttribute("rs",list);
        response.sendRedirect("dian.jsp"); 
        conn.close();   

                获取
                <c:forEach items="rs" var="user" >  
     <c:out value="${user.sShopName}"/>
          </c:forEach>  

这样写报错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: An exception occurred processing JSP page /dian.jsp at line 55

52: <!-- Codrops top bar --><!--/ Codrops top bar -->
53: <!--

<%Object q=session.getAttribute("rs"); %><%=q %>-->
54:

55:
56:

57: /c:forEach

58:

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

2个回答

QQ863017854
QQ863017854   2016.04.27 14:00
已采纳

已解决

wq1009bbbb
wq1009bbbb   2016.04.26 14:28

items=${rs}

wq1009bbbb
wq1009bbbb 回复QQ863017854: 内部错误,找其他原因,exception 找root cause,你这是什么玩意..
一年多之前 回复
QQ863017854
QQ863017854 报错 HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request.
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!