Dear All,
It seems if a resource sets a result code other than 200 in its
initialisation methods (doInit) , then it is only possible to get empty
representation back. This is an issue, if one would like to return a
representation of a resource if the result code is e.g. HTTP Accepted
(202) .
Finder.class , lines 512-525
} else {
targetResource.init(getContext(), request,
response);
if
(response.getStatus().equals(Status.SUCCESS_OK)) {
targetResource.handle();
} else {
// Probably during the instantiation of the
target
// server resource, or earlier the status was
// changed from the default one. Don't go
further.
}
targetResource.release();
}
The HTTP Spec says on result code 202 the entity should contain
information how/when the request will be fulfilled, therefore the
representation should not be empty.
The workaround will be of course not to set the response code in
doInit() - is it just considered bad practice or there is some other
reason behind the current approach in Restlet Finder code?
Best regards,
Nina Jeliazkova
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2593448