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

  • Spring data Pageable+ Jersey response

    Hi,

    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,
    RJV
Working...
X