I am doing pagination and I followed this link and it works!
However, I am facing problem with indexing. I am fetching large amount of data and total number of pages are around 100.
All the page numbers are displaying in main jsp page itself. It means 1 2 3 4 5 6 7 8 ----- 97 98 99 100 Next.
But i want to display 1 2 3 4 5 6 7 8 9 10 then next.
So can anyone please suggest how can I implement this method instead? Thanks in advance! :)
<c:forEach begin="1" end="${noOfPages}" var="i">
<c:choose>
<c:when test="${currentPage eq i}">
<button type="button" onclick="location.href='...?page=${i}';">${i}</button>
</c:when> <c:otherwise>
<button type="button" onclick="location.href='...?page=${i}';">${i}</button>
</c:otherwise>
</c:forEach>