users@jersey.java.net

[Jersey] Re: How to catch a exception by a filter or interceptor

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Fri, 10 Jun 2011 15:29:44 +0200

Please see the standard ExceptionMapper JAX-RS feature [1].
You just need to implement such a mapper for your exception
and register it within your application.

HTH,

~Jakub

[1]http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/ext/ExceptionMapper.html

On 06/10/2011 04:34 AM, jiangc1987 wrote:
> I want to writer a interceptor/filter to implement the fuction as below.
> for Example:
> If I login the system,with a wrong passworld, the old system will throw a
> exception ,,Now I want ot catch this exception,Then re-write the response
> and tell the client that he/she input a wrong passowrd
>
> how shold i do it?
> thanks advance.
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/How-to-catch-a-exception-by-a-filter-or-interceptor-tp6460709p6460709.html
> Sent from the Jersey mailing list archive at Nabble.com.
>