SlideShare a Scribd company logo
ExceptionHandler & ControllerAdvice
http://pigbrain.github.io
이현동
ExceptionHandler
A_Controller.class
public String method(…) {
throw new Aexception();
}
Throws
@ExceptionHandler(value = Aexception.class)
….
ExceptionHandler
Throws
ControllerAdvice
A_Controller.class
B_Controller.class
C_Controller.class
D_Controller.class
@ControllerAdvice
@ExceptionHandler(value = Aexception.class)
….
@ExceptionHandler(value = Bexception.class)
….
@ExceptionHandler(value = Cexception.class)
….
@ExceptionHandler(value = Dexception.class)
….
Throws
ControllerAdvice
Throws
ExceptionHandler + ControllerAdvice
A_Controller.class
public String method(…) {
throw new Aexception();
}
@ExceptionHandler(value = Aexception.class)
….
@ControllerAdvice
@ExceptionHandler(value = Aexception.class)
….
@ExceptionHandler(value = Bexception.class)
….
@ExceptionHandler(value = Cexception.class)
….
@ExceptionHandler(value = Dexception.class)
….
동일한 Exception에 대하여 ExceptionHandler를 두 곳에 선언해 놓으면 ?
ExceptionHandler + ControllerAdvice
A_Controller.class
public String method(…) {
throw new Aexception();
}
@ExceptionHandler(value = Aexception.class)
….
@ControllerAdvice
@ExceptionHandler(value = Aexception.class)
….
@ExceptionHandler(value = Bexception.class)
….
@ExceptionHandler(value = Cexception.class)
….
@ExceptionHandler(value = Dexception.class)
….
Class에 선언된 ExceptionHandler가 우선시된다
ExceptionHandlerExceptionResolver.java
. . . .
Class에 선언된 ExceptionHandler가 우선시된다
감사합니다.

More Related Content

DOCX
Program to remove Left factoring
DOCX
Netbeans elminar
DOC
程式碼測試
PPTX
Actors in erlang
PDF
A middleware system between web and database servers
PDF
PPTX
Dylan o‘brien
PPTX
Biography ariana grande
Program to remove Left factoring
Netbeans elminar
程式碼測試
Actors in erlang
A middleware system between web and database servers
Dylan o‘brien
Biography ariana grande

Viewers also liked (19)

TXT
New text document
PDF
Experience Design Analysis_DXB402
PPTX
Muslim shariah
DOCX
professional cover letter
PDF
Page 1 mode en provence garella
PPTX
Sergio briceño pw
PDF
Справочное пособие: "Путеводитель по библиотеке"
PPTX
10. Manejo palto orgánico II
PPTX
함수형 사고
PDF
Exception handling & logging in Java - Best Practices (Updated)
PPTX
Google classroom open house
PPT
Erlang Concurrency
PDF
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
PPTX
Cultivo de cebolla1
PDF
Getting started with BeagleBone Black - Embedded Linux
PPTX
Spring 테스트 컨텍스트 프레임워크
PPTX
Websocket of Spring
PPTX
The mystique of erlang
New text document
Experience Design Analysis_DXB402
Muslim shariah
professional cover letter
Page 1 mode en provence garella
Sergio briceño pw
Справочное пособие: "Путеводитель по библиотеке"
10. Manejo palto orgánico II
함수형 사고
Exception handling & logging in Java - Best Practices (Updated)
Google classroom open house
Erlang Concurrency
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Cultivo de cebolla1
Getting started with BeagleBone Black - Embedded Linux
Spring 테스트 컨텍스트 프레임워크
Websocket of Spring
The mystique of erlang
Ad

Exception Handler, Controller Advice Of Spring