본문 바로가기

0x02 Platform & Framework/0x024 Jersey Framework

Jersey에서 ErrorHandling을 Customize하는 방법

http://stackoverflow.com/questions/583973/jax-rs-jersey-how-to-customize-error-handling



1. WebApplicationException을 상속받아 기존 정의된 Error를 Customizing 하여 Exception을 던지는 방법


2. Custom Exception을 정의하여 해당 Exception을 @Provider로 Mapping 하여 Framework에서 해결하는 방식


http://www.bhaveshthaker.com/25/customize-handling-server-side-exceptions-with-error-codes-using-exceptionmapper-with-jersey-jax-rs-in-java/