Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未在arraylist中显示所有值_Java_Mysql_Jsp_Arraylist - Fatal编程技术网

Java 未在arraylist中显示所有值

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> <

我试图使用arraylist在jsp页面中显示一些值,但它显示了除顶行值以外的所有值。下面是我写的代码

    <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
卡号。
注明日期
到期日

您是否通过单元测试验证了过滤代码返回了正确的数组?没有。我在那里得到的值与我在这里得到的值相同。可能是因为早期的编码有问题。谢谢你让我这么做。