0

I have requirement to implement pagination using Spring MVC 3. I am getting list of 1000 numbers from a Web Service. Now i want to show 5 nos. at a time and when user go to next page then 5 nos and so on. Someone please give me some pointers on this.

sathish_at_madison
  • 823
  • 11
  • 34
user3592257
  • 105
  • 1
  • 3
  • 16

2 Answers2

1

You can use the PagedListHolder api.

Similar question is answered check this link.

This previous link can solve the right away. From GitHub there are new API's that are springing to solve this issue. There is a spring framework tailored pagination, you can take look at some of the links

spring pagination

Community
  • 1
  • 1
sathish_at_madison
  • 823
  • 11
  • 34
0

This is not specific to Spring MVC, but will work with Spring MVC. DataTables is a jQuery plugin that nicely formats tabulated data and provides configurable paging out of the box.

Add the following to your JSP:

<script type="text/javascript" src="<c:url value='/resources/DataTables/media/js/jquery.dataTables.min.js'/>"></script>

...

$(document).ready(function() {
    $('#myTable').dataTable();
});

Make sure that your table uses thead and tbody tags on your table.

Paul Croarkin
  • 14,496
  • 14
  • 79
  • 118
  • Could you please elaborate this. I have a list of 1000 + id's and want to show them in 5 at one page and so on. Could you please give me an example. – user3592257 Jun 20 '14 at 03:08