0

jsp 内でページネーションを実行していますが、jstl で結果が出力されません

 <%
        RecordDao dao = new RecordDao();
        int pg = 1;
        int recordsPerPage = 5;
        if(request.getParameter("pg") != null) {
          pg = Integer.parseInt(request.getParameter("pg"));
                }
        List<RecordBean> recordList = dao.getAllRecords((pg-1)*recordsPerPage, recordsPerPage);
        int noOfRecords = dao.getNoOfRecords();
        int noOfPages = (int) Math.ceil(noOfRecords * 1.0 / recordsPerPage);
        request.setAttribute("recordList", recordList);
        request.setAttribute("noOfPages", noOfPages);
        request.setAttribute("currentPage", pg);
    %>
   <table>
     <c:forEach var="record" items="${recordList}">
        <tr>
            <td>${record.data1}</td>
            <td>${record.data2}</td>
            <td>${record.data3}</td>
            <td>${record.data4}</td>
            <td>${record.data5}</td>               
        </tr>
    </c:forEach>
   </table>

 <c:if test="${currentPage != 1}">
    <a href="DemoList.jsp?pg=${currentPage - 1}">Previous</a>
 </c:if>

 <c:if test="${currentPage lt noOfPages}">
    <a href="DemoList.jsp?pg=${currentPage + 1}">Next</a>
 </c:if>

クロム内の要素を検査すると、次の結果が得られます..

  <c:foreach var="record" items="[com.java.bean.RecordBean@149a5a3, com.java.bean.RecordBean@19a655, com.java.bean.RecordBean@1f748c4, com.java.bean.RecordBean@1ca3cde, com.java.bean.RecordBean@621bf1">
  </c:foreach>
4

1 に答える 1