随笔分类 -  SpringBoot

摘要:实现功能:使用AOP统计方法执行耗时 Maven依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> 自定 阅读全文
posted @ 2022-07-13 09:55 卡卡罗特琪琪 阅读(2069) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/panlei3707/p/11208811.html 阅读全文
posted @ 2022-06-20 16:52 卡卡罗特琪琪 阅读(41) 评论(0) 推荐(0) 编辑
摘要:背景就是某银行影像系统,上传下载字段全是大写的,可以用该注解解决。 @JsonAutoDetect 定义字段、方法的访问可见性规则 默认情况下,Jackson 只使用 public 的字段进行序列化和反序列化。没有 public 字段时,会使用 public 的 getters/setters。可以 阅读全文
posted @ 2022-05-05 11:44 卡卡罗特琪琪 阅读(2475) 评论(0) 推荐(0) 编辑
摘要:介绍 通常我们在开发的过程中,需要对前端传入的数据进行校验,尽管这一步已经在前端进行了一次校验,虽然现在已经有了很多校验的注解,@NotNull、@NotBlank、@URL等一系列注解帮助我们进行校验,但是在实际的业务开发过程中,这些可能不足以满足我们的需求,这时候我们就需要自己来定义注解了。 示 阅读全文
posted @ 2022-04-20 11:52 卡卡罗特琪琪 阅读(320) 评论(0) 推荐(0) 编辑
摘要:前端必要的设置 <form role="form" th:action="@{/upload}" method="post" enctype="multipart/form-data"> 单文件上传 <input type="file" name="headerImg" id="exampleInp 阅读全文
posted @ 2022-03-11 17:46 卡卡罗特琪琪 阅读(839) 评论(0) 推荐(0) 编辑
摘要:实现 HandlerInterceptor 接口 @Slf4j public class LoginInterceptor implements HandlerInterceptor { /** * 目标方法执行之前 * @param request * @param response * @par 阅读全文
posted @ 2022-03-11 10:39 卡卡罗特琪琪 阅读(521) 评论(0) 推荐(0) 编辑
摘要:前言 Spring声明式事物的实现,有两种方式;第一种是配置xml,第二种是使用相关注解(这两种方式可详见《程序员成长笔记(一)》的相关章节)。SpringBoot中默认配置了第二种方式,所以,SpringBoot直接使用注解即可。下面介绍SpringBoot通过注解开启事物的使用。 SpringB 阅读全文
posted @ 2021-10-25 08:58 卡卡罗特琪琪 阅读(289) 评论(0) 推荐(0) 编辑
摘要:这是两种情况 解决办法可以用spring-session 阅读全文
posted @ 2021-09-05 14:47 卡卡罗特琪琪 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Starter的准备工作 因为需要一个starter和一个autoconfigure,其中starter引用着autoconfigure 用Spring Init新建一个项目 pom.xml如下 <?xml version="1.0" encoding="UTF-8"?> <project xmln 阅读全文
posted @ 2021-08-25 09:46 卡卡罗特琪琪 阅读(59) 评论(0) 推荐(0) 编辑
摘要:引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 默认只是开启了health,info,修 阅读全文
posted @ 2021-08-22 10:05 卡卡罗特琪琪 阅读(70) 评论(0) 推荐(0) 编辑
摘要:引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> 添加配置 (默认client-typ 阅读全文
posted @ 2021-08-22 08:55 卡卡罗特琪琪 阅读(393) 评论(0) 推荐(0) 编辑
摘要:引入依赖 <!--整合mybatis-plus,因为其中整合了spring-boot-starter-data-jdbc和mybatis-spring-boot-starter,所以注释掉--> <dependency> <groupId>com.baomidou</groupId> <artifa 阅读全文
posted @ 2021-08-19 21:43 卡卡罗特琪琪 阅读(314) 评论(0) 推荐(0) 编辑
摘要:引入依赖 <!--整合mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.4</ver 阅读全文
posted @ 2021-08-16 22:59 卡卡罗特琪琪 阅读(33) 评论(0) 推荐(0) 编辑
摘要:第一种 自定义方式 如何使用 引入依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.17</version> </dependency> 编写配置类 @Configur 阅读全文
posted @ 2021-08-14 16:44 卡卡罗特琪琪 阅读(317) 评论(0) 推荐(0) 编辑
摘要:前端表单 <form role="form" th:action="@{/upload}" method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="exampleInputEmail1">邮箱 阅读全文
posted @ 2021-07-31 18:01 卡卡罗特琪琪 阅读(84) 评论(0) 推荐(0) 编辑
摘要:有两种方式 前言 第一种,在实体类字段添加注解 @DateTimeFormat 第二种,在application.yml添加配置 验证结果 阅读全文
posted @ 2021-07-30 09:27 卡卡罗特琪琪 阅读(388) 评论(0) 推荐(0) 编辑
摘要:条件装配 @ConditionalOnBean(name="tom") 当tom组件存在时,以下的组件才可以获取到。 @ConditionalOnMissingBean(name="tom") 当tom组件不存在时,以下的组件才可以获取到。 刚好相反 拦截器原理 阅读全文
posted @ 2021-07-23 17:01 卡卡罗特琪琪 阅读(107) 评论(0) 推荐(0) 编辑
摘要:启动携带着配置参数 阅读全文
posted @ 2021-07-10 08:09 卡卡罗特琪琪 阅读(42) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示