我有这样的异常处理程序:
@ControllerAdvice
public classMyExceptionHandler extends ResponseEntityExceptionHandler {
@ExceptionHandler(MyRuntimeException.class)
public String handleMyRuntimeException(MyRuntimeExceptionexception ex){
LOGGER.info(ex.getMessage());
return "redirect:/www.google.com";
}
}
我执行 http 请求,我看到 Controller 处理了我的请求,然后MyRuntimeException正在抛出并且handleMyRuntimeException正在调用方法。但在邮递员中,我看到服务器返回 401 http 状态,而我在响应标头中看不到 www.google.com。
我错了什么?
