Hi,
Could somebody point out what could be wrong with the following attempt to
return an image from a REST response? I'm using 2.1m5 with JAXRS extension (JSR
311) and I have the following method:
@GET
@Path("/photo/{id}")
@Produces("image/jpeg")
public byte [] getPhoto()
{
byte [] image = // obtain image as a binary area from somewhere
return image;
}
I'm trying to display the image in a browser (Chrome or Mozilla), but it fails
to load it. It hangs for a while and then complains with:
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without
sending any data.
I've trying constructing a Response object with appropriate media type and
various different entity types (a File, a GenericEntity and what not), but all
with the same result. I'm sure the image data is correct. I tried tracing with
the debugger the whole stack of Restlet framework "filter this, filter that" on
the response, but I'm not familiar with the code...I can spend further type
stepping with the debugger if pointed at the right direction.
Thanks!
Boris
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2793909