这段时间使用springboot搭建基础框架,作为springboot新手,各种问题都有. 当把前端框架搭建进来时,针对所有controller层的请求,所发生的异常,需要有一个统一的异常处理,然后返回错误页面.其中方法很多,可以使用拦截器,或者filter,我是使用controlleradvice注解. package org.lhzhian.base.exception; import org.springframework.web.bind.annotation.ControllerAdv…