Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Json response for rest webservice  RSS feed

 
vijay jacob
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Basically i am writing using jersey library.

@produce annotation i have configured to MediaType as json.

Feed method(){

return Feed }

Feed is an entity with 3 fields.

So here the object is transformed into a json respons by jersey @produce annotation. How exactly it is ?
 
Kesava Krishna
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,

Jersey has got inbuilt MessageBodyRaders which will take care of converting the method output to json/xml. If you need to override this write your own MessageBodyWriters and configure.

Thanks,
Kesava
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!