Given that HttpContext is a Jersey 'extension' - how would one access
the response object if not using the ResponseBuilder pattern?
E.g. if I had
public StreamingOutput getResource(
final @Context HttpContext hc, // Jersey
specific class
@PathParam("id") String id
) {
return new StreamingOutput() {
public void write(OutputStream outputStream) {
Response resp = hc.getResponse();
// do something with response, e.g. set headers
PrintWriter out = new PrintWriter(outputStream);
out.println("Foo");
out.close();
} };
}
How could I avoid the Jersey specific class?
Thanks,
Jan
P.S. Is there actually a better list to use for these kinds of
questions? Seems so quiet over here...