Comments (1)
DispatcherServlet 클래스의 doDispatch 메소드에서 해당 부분을 확인할 수 있다.
밑에 코드로 확인해 보면, try-catch 문으로 구현된 것으로 확인할 수 있다.
요청이 들어왔을 때, 해당하는 컨트롤러의 로직이 실행되고, 예외가 발생했을 때는 processDispatchResult 메소드에서 처리된다.
public class DispatcherServlet {
protected void doDispatch(...) throws Exception {
// ...
try {
ModelAndView mv = null;
Exception dispatchException = null;
try {
// Controller 로직 실행 (핸들러를 찾고, 해당 로직을 실행)
} catch (Exception ex) {
dispatchException = ex;
}
// Dispatch 결과 처리 (예외 처리도 여기서 진행)
processDispatchResult(...,dispatchException);
} catch {...}
// ...
}
}
from cleancode.
Related Issues (16)
- 함수당 추상화 수준은 하나로! HOT 5
- 수직 거리 - protected 변수를 피해야 하는 이유 HOT 1
- DTO를 사용하는 이유 HOT 3
- checked exception이 필요한 경우 HOT 1
- [Effective Java] Exception에 관한 규약 HOT 1
- 예외(null) 대신 기본값을 리턴 HOT 3
- 자바에서 null을 안전하게 다루는 방법 HOT 1
- checked exception과 unchecked exception (feat. roll-back) HOT 1
- SpringBoot의 다양한 예외 처리 방법 HOT 10
- 애초에 null을 넘기지 못하도록 금지하는 정책 HOT 1
- 도메인 특화된 언어 사용 HOT 1
- 프로세스가 동기화하는 기본 알고리즘과 해법
- Servlet 동시성의 내부 구현
- 공유 객체 하나에 여러 메서드가 필요한 상황에는 3가지 방법을 고려
- Thread Safe한 collection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cleancode.