我将数据库查询结果保存在Result类型的变量A中通过Servlet
request.setAttribute("pet_List", A);
RequestDispatcher dispatcher=request.getRequestDispatcher("petview_name.jsp");
dispatcher.forward(request, response);
转发到显示页面,请问在显示页面怎么通过标签输出,显示页面不要有jsp代码。
request.setAttribute("pet_List", A);
RequestDispatcher dispatcher=request.getRequestDispatcher("petview_name.jsp");
dispatcher.forward(request, response);
转发到显示页面,请问在显示页面怎么通过标签输出,显示页面不要有jsp代码。
${ins}</c:forEach>
要是这样的话forEach同样用呀。
<c:forEach var="ins" items="${pet_List}">
<c:set var="list" value="${ins}"/>
<c:forEach var ="obj" items="${list}">
${obj.xxx}
</c:forEach>
</c:forEach>
<%
//书名:bname
//作者:author
//价格:price
Result ds=dao.ListBook();
out.print(ds.getRowsByIndex()[0][2]);
%>
<table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>书名</th>
<th>作者</th>
<th>价格(元)</th>
<th>操作</th>
</tr>
<c:forEach var="book" items="${ds}" varStatus="status">
<tr>
<td></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</c:forEach>
</table>