Java 未在arraylist中显示所有值
我试图使用arraylist在jsp页面中显示一些值,但它显示了除顶行值以外的所有值。下面是我写的代码Java 未在arraylist中显示所有值,java,mysql,jsp,arraylist,Java,Mysql,Jsp,Arraylist,我试图使用arraylist在jsp页面中显示一些值,但它显示了除顶行值以外的所有值。下面是我写的代码 <table border="1"> <tr> <th>Book ID</th> <th>Branch ID</th> <th>Card No.</th> <th>Date Out</th> <
<table border="1">
<tr>
<th>Book ID</th>
<th>Branch ID</th>
<th>Card No.</th>
<th>Date Out</th>
<th>Due Date</th>
</tr>
<%
LibModel lm=(LibModel)request.getAttribute("data");
for(int a=0;a<lm.branch_id.size();a++) {
%>
<tr>
<td><%= lm.book_ids.get(a)%></td>
<td><%= lm.branch_id.get(a)%></td>
<td><%= lm.cards.get(a)%></td>
<td><%= lm.date_out.get(a)%></td>
<td><%= lm.due_date.get(a)%></td>
</tr>
<% }%>
</table>
书号
分支ID
卡号。
注明日期
到期日
您是否通过单元测试验证了过滤代码返回了正确的数组?没有。我在那里得到的值与我在这里得到的值相同。可能是因为早期的编码有问题。谢谢你让我这么做。