[springboot]AOP handles page jump exceptions perfectly

First, page jump exception handling

The blogger has created a new CSDN community "architect training camp" looking forward to your joining: https://bbs.csdn.net/forums/zimug. The previous chapters are all about the exception handling of the JSON interface class. If we are doing page template development (non-front-end and back-end separated applications), what should we do if an exception occurs in the Controller? We should jump to the error.html page uniformly, And it cannot affect the global unified exception handling of the JSON data interface .

  • The problem faced: the
    programmer throws a custom exception CustomException (single responsibility), and returns @ResponseBody AjaxResponse after the global exception handling interception, not ModelAndView, so we cannot jump to the error.html page, then how do we do the page jump error .html way of global exception handling?

Guess you like

Origin blog.csdn.net/hanxiaotongtong/article/details/122892989