1、搭建一个SpringBoot项目并在pom.xml中添加web启动即可<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>

3、新建一个异常处理器ControllerExceptionHandler

5、启动项目,开始测试


时间:2024-10-11 20:26:50
1、搭建一个SpringBoot项目并在pom.xml中添加web启动即可<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>
3、新建一个异常处理器ControllerExceptionHandler
5、启动项目,开始测试