users@jersey.java.net

[Jersey] Re: handling nulls

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Tue, 25 Jan 2011 14:48:04 +0100

On Jan 21, 2011, at 2:32 PM, Florian Hehlen wrote:

> Thanks for the responses.
>
> I have opted to keep the 404 and add application readable codes in
> the header. That way the headers can be read fine grained
> understanding. It still doesn’t please me that on both the server
> and client side exception handling is needed to process what
> essentially is a null. I will go back and look at the suggested
> ResourceFilterFactory later.
>

OK, that may improve the server side.

Presumably on the client side you will need to have different code
blocks processing the 200 and 404 yes? If you don't want to handle the
404 case using an exception you could obtain a ClientResponse and
manually check the status code in a if/else block.

Paul.