Friday, September 6, 2013

Spring data "Page" based bootstrap pager

Spring data "Page" provides a good abstraction for a Page of records, and has fields to access the current page that is being displayed, the count of all the records and the page size.

A good pager control can be built in jsp, given a Page of records, something like the following:



I have created a small gist with just such a jsp tag library, and it internally displays this pager using twitter bootstrap based styling. Using this tag library is simple, it just requires a "Page" as an attribute:

<util:pagination thispage="${aPage}"></util:pagination>


Here is a copy of the gist:

No comments:

Post a Comment