GithubHelp home page GithubHelp logo

Comments (1)

hyeyoungs avatar hyeyoungs commented on September 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.