• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAX-RS

 
Milindu Sanoj Kumarage
Greenhorn
Posts: 9
Android Google App Engine jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing a RESTful service using JAX-RS and JAX-B. I have a Complain class , following is a striped down version of it.




Note I have decorated getCommentCollection with @XmlTransient annotation, because I don't want to see comment when I'm looking for all the complains ( @path('/') )
But when I'm looking for a specific complaint( @path('/{id}') ), I need the comments to appear in the XML output.

Since I have decorated getCommentCollection with @XmlTransient annotation I can't get comments when I'm looking for a specific complaint( @path('/{id}') ). How can I achive this?

thanks in advance
 
Vijitha Kumara
Bartender
Posts: 3952
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know the entire model for this use case you are referring, but I guess you need to define the paths and the expected results properly. For example if you need to get a complain then a URL of .../complain/{id} would do. You can define the expected content and implement it as needed based on the requirement.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!