摘要:
所需依赖 点击查看代码 <!-- 校验注解实现--> <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator --> <dependency> <groupId>org.hibernate 阅读全文
摘要:
全局异常处理机制 /** * 全局异常处理器 * 应用到所有@RequestMapping注解的方法,在其抛出Exception异常时执行 */ //@ControllerAdvice //可以返回逻辑视图 转发和重定向的! @RestControllerAdvice //直接返回json字符串 p 阅读全文
摘要:
  阅读全文
摘要:
准备工作 1.导入json依赖 点击查看代码 <!-- jsp需要依赖! jstl--> <dependency> <groupId>jakarta.servlet.jsp.jstl</groupId> <artifactId>jakarta.servlet.jsp.jstl-api</artifa 阅读全文
摘要:
准备工作 1.导入json依赖 点击查看代码 <!--jackson依赖--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version> 阅读全文
摘要:
DispatcherServlet SpringMVC提供,我们需要使用web.xml配置使其生效,它是整个流程处理的核心,所有请求都经过它的处理和分发 HandlerMapping SpringMVC提供,我们需要进行IoC配置使其加入IoC容器方可生效,它内部缓存handler(controll 阅读全文