Hmm, you can create a custom Response object in a jersey this way: this will return 200:
@GET public Response get() { URI uri=new URI("http://nohost/context"); Viewable viewable=new Viewable("/index", "FOO"); return Response.ok(viewable).build(); }
to return something else, use this approach:
@GET public Response get() { int statusCode=204; Viewable myViewable=new Viewable("/index","FOO"); return Response.status(statusCode).entity(myViewable).build(); }
Hope this helps ....
fasseg
source share