这是起作用的方法:我接受了axtavt的建议(用注释
@Component),并将此方法添加到控制器中:
@ExceptionHandler(CustomException.class)public @ResponseBody CustomException handleException(CustomException ex) { return ex;}
这是起作用的方法:我接受了axtavt的建议(用注释
@Component),并将此方法添加到控制器中:
@ExceptionHandler(CustomException.class)public @ResponseBody CustomException handleException(CustomException ex) { return ex;}