I define a customized status code(299) to handle the case of a success request
with no data found. I tried two different ways to set this status code(see
below), but the status code client receives is 404, not 299. There's no place
in my codes to set status to 404, so this 404 must be generated by Resetlet
automatically.
If I change 299 to any 400-level or 500-level code, for example, 499, then it
works fine. Does anyone know why?
If there any way I can set a status of 299?
Thanks.
<code>
// somewhere define my customized status
public static Status SUCCESS_NO_DATA = new Status(299);
//
public Representation represent(Variant variant) throws ResourceException
{
try {
// ...
} catch (Exception e) {
// OPTION getResponse().setStatus(SUCCESS_NO_DATA, "No Data");
// OR
// OPTION 2
throw new ResourceException(SUCCESS_NO_DATA, "No Data", e);
}
}
</code>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=981976