摘要: Spring Boot 常用注解汇总 一、启动注解 @SpringBootApplication @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfi 阅读全文
posted @ 2021-12-06 15:02 满Sir 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 我们开发任何一个Spring Boot项目,都会用到如下的启动类 1 @SpringBootApplication 2 public class Application { 3 public static void main(String[] args) { 4 SpringApplication. 阅读全文
posted @ 2021-12-06 14:57 满Sir 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 阅读目录: 序言 一、静态:基于注解 二、动态:基于接口 三、多线程定时任务 阅读正文: 回到顶部 序言 使用SpringBoot创建定时任务非常简单,目前主要有以下三种创建方式: 一、基于注解(@Scheduled) 二、基于接口(SchedulingConfigurer) 前者相信大家都很熟悉, 阅读全文
posted @ 2021-12-06 14:37 满Sir 阅读(968) 评论(0) 推荐(0) 编辑
摘要: 本节内容 正则表达式简介 正则表达式中的字符 元字符详解 常用正则表达式实例 正则表达式的匹配过程 正则表达式中的标志位-flag 参考资料 需要提前说明的是: 正则表达式的语法是由正则表达式引擎决定的(目前主流的正则引擎分为3类:DFA、传统型NFA 和 POSIX NFA),不同编程语言或应用程 阅读全文
posted @ 2021-12-06 14:10 满Sir 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 一、校验数字的表达式 1. 数字:^[0-9]*$ 2. n位的数字:^\d{n}$ 3. 至少n位的数字:^\d{n,}$ 4. m-n位的数字:^\d{m,n}$ 5. 零和非零开头的数字:^(0|[1-9][0-9]*)$ 6. 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+( 阅读全文
posted @ 2021-12-06 14:07 满Sir 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 代码: import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframewor 阅读全文
posted @ 2021-12-06 09:50 满Sir 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 说起spring,我们知道其最核心的两个功能就是AOP(面向切面)和IOC(控制反转),这边文章来总结一下SpringBoot如何整合使用AOP。 一、示例应用场景:对所有的web请求做切面来记录日志。 1、pom中引入SpringBoot的web模块和使用AOP相关的依赖: 其中:cglib包是用 阅读全文
posted @ 2021-12-06 09:49 满Sir 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 借鉴:http://www.cnblogs.com/xrq730/p/4919025.html https://blog.csdn.net/zhaokejin521/article/details/50144753 http://www.importnew.com/24305.html AOP介绍 阅读全文
posted @ 2021-12-06 09:30 满Sir 阅读(208) 评论(0) 推荐(0) 编辑
摘要: @Transactional spring 事务注解 1.简单开启事务管理 @EnableTransactionManagement // 启注解事务管理,等同于xml配置方式的 <tx:annotation-driven /> 2.事务注解详解 默认遇到throw new RuntimeExcep 阅读全文
posted @ 2021-12-06 09:21 满Sir 阅读(267) 评论(0) 推荐(0) 编辑
摘要: * 集合操作常用方法类. * <p> * * @author 柯 */ public class ListUtil { /** * 判断List不为空,非空返回true,空则返回false * * @param list * @return boolean */ public static bool 阅读全文
posted @ 2021-12-06 09:17 满Sir 阅读(246) 评论(0) 推荐(0) 编辑