Announcement Announcement Module
No announcement yet.
Spring data Pageable+ Jersey response Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring data Pageable+ Jersey response


    I am implementing a paginated search using Spring-data findAll(Specification s, Pageable p) and it works fine to get the results as Page<CustomEntity>. I need to return this as a Jersey response or any other appropriate Object with all the attributes such as number of pages, hasNextPage etc so that I can display the page links in the UI (using JQuery). I am getting error while trying to convert the Page<CustomEntity> to a Response from the Jersey Rest resource.

    What is the suitable Response Type/Object to be returned from Jersey Rest method in such calls? One way I can think of is to have a custom DTO/VO to hold the search results along with other related attributes. Is there an alternate/better approach?

    Thanks much,