Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity filtering for Jax-rs using RestEasy

 
Kesava Krishna
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building restful services using rest easy. I have few services which have to address different views of same Model/Resource.

Ex:- Model is Project Short View :- I have to return only few members of the resource Detailed View - I have to return all members of the resource

Want to know if there is jax-rs specification or Rest EASY API to support this. If not please throw some pointers on how to acheive it.

Let me know if i have to provide more background
 
Ron McLeod
Saloon Keeper
Posts: 1263
133
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about different URL paths for Short and Detailed views:
      /projects/{projectId}/views/short-view
      /projects/{projectId}/views/detailed-view
 
Kesava Krishna
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For each path if I need to have a separate operation, since the service functionality is same it might be duplicating the same code into two operations. What do you say?
 
Ron McLeod
Saloon Keeper
Posts: 1263
133
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Factor-out the common code and put it in a method which is called for both URLs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!