package com.qf.common;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
/**
* 统一异常处理类
*/
@ControllerAdvice
public class MyExceptionHandler {
@ExceptionHandler(NullPointerException.class)
public String nullExp(){
return "/err1.jsp";
}
@ExceptionHandler(NumberFormatException.class)
public String NumFormatExp(){
return "/err2.jsp";
}
}
MVC异常处理类
最新推荐文章于 2025-12-17 19:02:04 发布
669

被折叠的 条评论
为什么被折叠?



