O'Reilly logo

Spring MVC Cookbook by Alex Bretet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required