如題
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: <!--
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)
已解決
。