1. 程式人生 > >SpringMVC配置全局異常(Exception)

SpringMVC配置全局異常(Exception)

ont cep div advice exc clas control .html pub

@ControllerAdvice
public class ErrorHandler {
    
    @ExceptionHandler(Exception.class)
    String handleException(Exception e){
        return "404.html";
    }

}

SpringMVC配置全局異常(Exception)