Search code examples
javaspring-mvcpaginationspring-data

How to convert a list of enity object to page object in Spring MVC (JPA)?


I have a List of entities. How do I convert it to Page Object using Spring MVC 4 and Spring Data JPA?


Solution

  • There is a Page implementation for that:

    final Page<Something> page = new PageImpl<>(theListOfSomething);