Adding pagination, filters, and sorting capabilities

Now we have introduced the basis for a REST configuration of Spring MVC, we will improve our REST services by adding pagination, filtering, and sorting capabilities.

Getting ready

Pagination is a concept developed in the Spring Data project. To add pagination, we will introduce the Pageable interface for wrapper implementations populated from the request. These are further on recognized and handled by Spring Data.

The Page interface and specifically the PageImpl instances can be produced by Spring Data to format its results. We will use them, as they are perfectly suited to REST rendering.

Finally, we will detail two data-binding tools used here to abstract filtering and pagination from our controllers' ...

Get Spring MVC: Designing Real-World Web Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.