• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RESTful Web service with JAX-RS - pagination and caching

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm planning to develop a REST Web service using JAX-RS.
I have a core banking system that gives me a list of entries (I cannot change it).

Pagination : I would like to be able to get the list of entries (example 400 entries) and send some of them to the web service client. When I ask the web service for the first time (for the first page), the entries are retrieved from the core banking system, cache them somewhere, and return the 10 first entries. When I ask the second page, I would like to retrieve the 400 entries from the cache and return the next set of 10 entries (next page).

My question is : where should I put this cache ?
Is it OK to use the HttpSession since RESTful web service should be stateless ?
What would you advice otherwise ?

Thanks in advance for your advices.

Hervé
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Restful api is stateless. (http://en.wikipedia.org/wiki/Representational_State_Transfer) You shouldn't use http session to store the state. You can do caching, but that should done in a distributed cache. The way i do pagination is doing through using a query parameter or header passing the page number and size. Hope this help.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic