Spring全家桶
文章平均质量分 60
Spring全家桶
一个大泥球
切记!数据结构和算法是内功。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
easyExcel实现动态标头(模板写入)
语雀 建议下载源码看 gitee easyExcel 源码下载更快 要的效果 mainHead 这个字段会变。 源码 com.alibaba.easyexcel.test.demo.fill.FillTest /** * 复杂的填充 * * @since 2.1.1 */ @Test public void complexFill() { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{",原创 2022-02-23 21:30:26 · 2780 阅读 · 0 评论 -
@JsonInclude(JsonInclude.Include.NON_NULL) 不生效问题,不返还null给前端
文章参考:点击调整 项目中使用的是:fastJson进行序列化,然后就是,返回给前端多余字段 直接使用,是不生效的。 @JsonInclude(JsonInclude.Include.NON_NULL) 实现WebMvcConfigurationSupport import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; impo原创 2021-11-30 15:14:06 · 3336 阅读 · 1 评论 -
web socket做实时推送
内容来源:点击跳转 主要是这个注解。 <!--socket--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> 配置类 im转载 2021-11-29 19:49:10 · 463 阅读 · 0 评论 -
SpringCloud 多模块依赖统一管理
新建maven工程 删除多余文件,只留下pom.xml 加入以下依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.2</version> <relativePath原创 2021-11-21 16:01:04 · 488 阅读 · 0 评论 -
GateWay 动态路由(从nacos上取)
动态路由的好处 网关动态路可以从redis中取,或者nacos都可以。好处有:修了配置能够动态更新 依赖 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </d原创 2021-10-28 20:43:14 · 852 阅读 · 0 评论 -
EasyExcel+MapStruct 实现导入导出
EasyExcel +MapStruct 简化excel导入导出工作量原创 2021-10-08 20:42:34 · 1053 阅读 · 0 评论 -
swagger+Knife4j学习
111111111111111111原创 2021-08-24 20:47:08 · 518 阅读 · 0 评论 -
SpringBoot所有的Starter以及常用依赖
官网 官网 列表 spring-boot-starter Core starter, including auto-configuration support, logging and YAML spring-boot-starter-activemq Starter for JMS messaging using Apache ActiveMQ spring-boot-starter-amqp Starter for using Spring AMQP and Rabbit MQ原创 2021-08-10 21:01:57 · 2052 阅读 · 0 评论 -
InstantiationAwareBeanPostProcessor 学习
简介 注意:我使用的是SpringBoot版本:2.5.3 BeanPostProcessor包括二个初始化相关方法,InstantiationAwareBeanPostProcessor:包括这个实例化相关方法,以及一个属性值相关方法,postProcessProperties(postProcessPropertyValues在此版本中被标记为过时) 先整体看一下,这个五个方法执行的顺序,如流程图 测试例子 相关文件 <?xml version="1.0" encoding="UTF-8"?&原创 2021-08-08 14:40:16 · 456 阅读 · 0 评论 -
@EnableAspectJAutoProxy注解源码学习
@EnableAspectJAutoProxy点进去,有两个Boolean类型变量: 一个:Boolean类型的proxyTargetClass 变量,true-cglib,false-java自带。默认false。 第二个Boolean类型变量:exposeProxy,控制代理的暴露方式,解决内部调用不能使用代理的场景,默认为false. 下面要用。 重点是:AspectJAutoProxyRegistrar.class,点进去 AspectJAutoProxyRegistrar public void原创 2021-07-27 19:12:46 · 386 阅读 · 0 评论 -
SpringBoot版本,SpringCloud版本与Alibaba微服务版本选择问题
SpringBoot 版本链接 https://spring.io/projects/spring-boot#learn Springcloud https://spring.io/projects/spring-cloud#learn SpringCloud-alibaba https://spring.io/projects/spring-cloud-alibaba#learn 版本要求 https://start.spring.io/actuator/info https://g原创 2021-05-27 21:00:57 · 326 阅读 · 0 评论 -
Spring项目指定生效的配置文件
Spring项目指定生效的配置文件 方式一:ApplicationContext.xml 文件位置src\main\resources\springApplicationContext.xml 添加 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchem原创 2021-05-28 20:55:38 · 911 阅读 · 0 评论 -
学习spring自动注入原理
学习spring自动注入原理 直接上代码 xxxAutoConfiguration 配置类 @Configuration @EnableConfigurationProperties(HelloProperties.class) @ConditionalOnClass(HelloService.class) @ConditionalOnProperty(prefix = "hello" ,value = "enabled",matchIfMissing = true) public class Hello原创 2021-03-31 10:17:39 · 443 阅读 · 0 评论 -
SpringBoot自动部署(热部署)与手动部署
1-maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>true</sc原创 2021-05-29 16:25:19 · 897 阅读 · 1 评论 -
Spring事务学习(仅作为自己的笔记)
Spring事务传播行为 事务传播行为类型 说明 PROPAGATION_REQUIRED(默认) 如果当前没有事务,就新建一个事务,如果已经存在一个事务中,加入到这个事务中。这是最常见的选择。 PROPAGATION_SUPPORTS 支持当前事务,如果当前没有事务,就以非事务方式执行。 PROPAGATION_MANDATORY 使用当前的事务,如果当前没有事务,就抛出异常。 PROPAGATION_REQUIRES_NEW 新建事务,如果当前存在事务,把当前事务挂起。 PROPAGATION_NOT_转载 2021-07-22 19:49:36 · 216 阅读 · 0 评论 -
AOP学习
应用场景 AOP-面向切面编程。主要功能:日志记录,性能统计,安全控制,事务处理,异常处理。我的理解是:将一些非业务逻辑代码,从业务代码中剥离出来,从而符合将不变的东西,从变化的部分抽离出来。 AOP与OOP:AOP是一种看待问题的一种方式,OOP也是。若把应用比作蛋糕,OOP将每一层看做是(用户模块,xxx模块),而AOP是竖着看。二者无孰优孰劣,AOP是OOP的一种补充。 动态代理与静态代理 代理,在现实生活很常见,比如租客,房东,二房东。三者之间的关系。 静态代理:只在程序运行之前,代理类与委托类的关转载 2021-07-21 15:08:37 · 177 阅读 · 0 评论 -
@SpringBootApplication注解源码学习
@SpringBootApplication @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class), @Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.cl原创 2021-07-15 18:15:03 · 199 阅读 · 0 评论
分享