users@jersey.java.net

[Jersey] ExceptionMapper

From: Mattias Jonsson <jolpes.net_at_gmail.com>
Date: Wed, 11 Feb 2009 02:31:32 -0800 (PST)

Hi!

In the ExceptionMapper, is it possible to return some information to the
caller and set the status some other than HTTP_OK?

Example: Returning "Couldn't find Foo"

  GenericEntity<String> entity = new GenericEntity<String>("Couldn't find
Foo") {};
  return Response.ok(entity).build();

As I understand the response code will be HTTP_OK (200)

I would like to set the response code to for example HTTP_NOT_FOUND (404)
and still return the information "Couldn't find Foo".

In this way both machines and humans can interpret the information.

Any ideas?

Regards,
Mattias
-- 
View this message in context: http://n2.nabble.com/ExceptionMapper-tp2307884p2307884.html
Sent from the Jersey mailing list archive at Nabble.com.