摘要: settings.gradle pluginManagement { repositories { maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle-plugin maven { url 'https 阅读全文
posted @ 2024-06-30 20:14 微风抚秀发 阅读(703) 评论(0) 推荐(0) 编辑
摘要: SpringCloud 小知识点 @RequiredArgsConstructor 自动创建一个包含所有被 final 修饰的属性的构造函数 Lombok 会自动为被注解的类生成构造函数,而无需手动编写 远程调用 方案一 RestTemplate 多个项目之间 无法直接调用, Spring 提供 R 阅读全文
posted @ 2023-12-05 23:04 微风抚秀发 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 所需依赖 点击查看代码 <!-- 校验注解实现--> <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator --> <dependency> <groupId>org.hibernate 阅读全文
posted @ 2023-09-19 17:40 微风抚秀发 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 全局异常处理机制 /** * 全局异常处理器 * 应用到所有@RequestMapping注解的方法,在其抛出Exception异常时执行 */ //@ControllerAdvice //可以返回逻辑视图 转发和重定向的! @RestControllerAdvice //直接返回json字符串 p 阅读全文
posted @ 2023-09-19 17:35 微风抚秀发 阅读(45) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2023.cnblogs.com/blog/2972955/202309/2972955-20230919172617093-1562872856.png) ![](https://img2023.cnblogs.com/blog/2972955/202309/2972955-20230919172640545-1033825486.png) 阅读全文
posted @ 2023-09-19 17:27 微风抚秀发 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 准备工作 1.导入json依赖 点击查看代码 <!-- jsp需要依赖! jstl--> <dependency> <groupId>jakarta.servlet.jsp.jstl</groupId> <artifactId>jakarta.servlet.jsp.jstl-api</artifa 阅读全文
posted @ 2023-09-19 17:21 微风抚秀发 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 准备工作 1.导入json依赖 点击查看代码 <!--jackson依赖--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version> 阅读全文
posted @ 2023-09-19 17:11 微风抚秀发 阅读(7) 评论(0) 推荐(0) 编辑
摘要: DispatcherServlet SpringMVC提供,我们需要使用web.xml配置使其生效,它是整个流程处理的核心,所有请求都经过它的处理和分发 HandlerMapping SpringMVC提供,我们需要进行IoC配置使其加入IoC容器方可生效,它内部缓存handler(controll 阅读全文
posted @ 2023-09-19 16:52 微风抚秀发 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 随机数 String s = UUID.randomUUID().toString(); System.out.println(s); //生成的字符串 含有 - 我们可以使用replaceAll 去掉 - String s1 = s.replaceAll("-", ""); System.out. 阅读全文
posted @ 2023-09-15 21:35 微风抚秀发 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 声明式事务 指使用注解或 XML 配置的方式来控制事务的提交和回滚 Spring声明式事务准备工作 1. 配置环境 <!-- 声明式事务依赖--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</a 阅读全文
posted @ 2023-09-15 12:19 微风抚秀发 阅读(16) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示