springboot 全局捕获异常
2020-12-13 04:42
标签:代码 ret hand code response handle 运行时 body bsp 未被try catch的运行时异常都会被以下代码捕获 springboot 全局捕获异常 标签:代码 ret hand code response handle 运行时 body bsp 原文地址:https://www.cnblogs.com/hhxylm/p/11118408.htmlimport org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@ControllerAdvice
public class EEcontroller {
@ExceptionHandler(RuntimeException.class)
@ResponseBody
public Map