Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @GET
  2. @Produces({MediaType.APPLICATION_XML, MediaType.WILDCARD})
  3. @ElementClass(response = MyList.class)
  4. public Response listXML(){
  5. MyList list = getList();
  6. return Response.status(
  7. Response.Status.FOUND).
  8. entity(list).type(MediaType.APPLICATION_XML).build();
  9. }
  10.  
  11.  
  12.  
  13. @GET
  14. @Produces({MediaType.APPLICATION_JSON})
  15. @ElementClass(response = MyList.class)
  16. public Response listJson(){
  17. MyList list = getList();
  18. return Response.status(
  19. Response.Status.FOUND).
  20. entity(list).type(MediaType.APPLICATION_JSON).build();
  21. }
  22.  
  23. No message body writer has been found for response class MyList.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement