随笔分类 -  Spring Boot

摘要:在Spring Boot中添加spring-boot-starter-data-redis依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</ 阅读全文
posted @ 2018-09-05 23:41 互联网荒漠 阅读(33611) 评论(2) 推荐(1)
摘要:前面的章节在分析SpringBoot启动过程中,我们发现SpringBoot使用Spring框架提供的SpringFactoriesLoader这个类,实现检索META-INF/spring.factories配置文件,并从配置文件中获取指定配置项(通常是特定的接口实现类),并实例化后加载到Spri 阅读全文
posted @ 2018-08-31 19:45 互联网荒漠 阅读(1037) 评论(0) 推荐(0)
摘要:事件及监听并不是SpringBoot的新功能,Spring框架早已提供了完善的事件监听机制,在Spring框架中实现事件监听的流程如下: 自定义事件,继承org.springframework.context.ApplicationEvent抽象类 定义事件监听器,实现org.springframe 阅读全文
posted @ 2018-08-31 16:34 互联网荒漠 阅读(34425) 评论(0) 推荐(3)
摘要:学习过springboot的都知道,在Springboot的main入口函数中调用SpringApplication.run(DemoApplication.class,args)函数便可以启用SpringBoot应用程序,跟踪一下SpringApplication源码可以发现,最终还是调用了Spr 阅读全文
posted @ 2018-08-31 02:29 互联网荒漠 阅读(2058) 评论(0) 推荐(1)
摘要:在学习使用springboot过程中,我们经常碰到以@Enable开头的注解,其实早在Spring3中就已经出现了类似注解,比如@EnableTransactionManagement、@ EnableWebMvc等,本文以@ EnableAutoConfiguration注解为例跟踪一下源码,分析 阅读全文
posted @ 2018-08-30 18:59 互联网荒漠 阅读(1225) 评论(0) 推荐(0)
摘要:@Configuration和@Bean Spring提供了注解@Configuration和@Bean注解用来配置多个Bean,在以前的Spring项目中可以通过xml的方式配置: <beans> <bean id=”xxxBean” class="aaa.bbb.xxxBean"></bean> 阅读全文
posted @ 2018-08-05 12:46 互联网荒漠 阅读(1426) 评论(0) 推荐(0)
摘要:回顾一下采用SSM开发项目时,项目中会存在多个配置文件,比如web.xml,配置Spring相关的applicationContext-springmvc.xml, applicationContext-dao.xml等,对于应用自身的配置,甚至还需要编写专门的代码去读取这些配置文件中的参数。在Sp 阅读全文
posted @ 2018-07-29 23:11 互联网荒漠 阅读(818) 评论(0) 推荐(0)
摘要:SpringBoot概述 Spring Boot的诞生简化了Spring应用开发,SpringBoot提供对Spring容器、第三方插件等很多服务的管理。对于大部分Spring应用,无论是简单的web系统还是构建复杂的系统,使用SpringBoot只需要少量的配置就可以完成。 与SSM、SSH等相比 阅读全文
posted @ 2018-07-29 23:07 互联网荒漠 阅读(720) 评论(0) 推荐(0)