0

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>
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
newbieinjavaversion2
  • 489
  • 5
  • 12
  • 23
  • Get the values from DB and store it main list. For displaying create temp list which contain only 10 elements. Do the logic based on – Sureshkumar Panneerselvan Jan 16 '14 at 03:36
  • 1
    Better you can use display tag as I have [answered](http://stackoverflow.com/q/19678246/1031945). There are advantages of using display tag, it provides pagination, sorting column, more useful is you can export the data in excel,CSV,PDF etc format. – Aniket Kulkarni Jan 16 '14 at 05:07

0 Answers0