spring boot Shangguigu study notes 06 ---Web

------Error handling mechanism------

  Default effect

    1 returns a default error page

   The client responds with json data by default

  Principle: Refer to ErrorMvcAutoConfiguration Error automatic configuration

    DefaultErrorAttributes

    BasicErrorController

    ErrorPageCustomizer

    DefaultErrorViewResolver

    step:

      Once the system has an error: ErrorPageCustomizer takes effect (custom error response rules)

 

  2 How to customize error responses

    1) Customize the error page

    2) Customize json error data

    

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325464183&siteId=291194637