摘要: 作用:加速系统访问、提升系统性能 (1)、JSR107 Java Caching定义了5个核心接口,分别是CachingProvider、CacheManager、Cache、Entry、Expiry (2) Spring的缓存抽象接口 Spring从3.1开始定义了org.springframew 阅读全文
posted @ 2019-02-03 17:31 SpringCore 阅读(256) 评论(0) 推荐(0) 编辑
摘要: (1)、这个场景所需要的依赖 (2)、编写自动配置 @Configuration //指定这个类是一个配置类 @ConditionalOnxxx //在指定条件成立的情况下自动配置类生效 @AutoConfigureAfter //指定自动配置类的顺序 @Bean //给容器中添加组件 @Confi 阅读全文
posted @ 2019-02-02 21:11 SpringCore 阅读(303) 评论(0) 推荐(0) 编辑
摘要: (1)、需要配置在META-INF/Spring.factories 1.ApplicationContextInitializer 2.SpringApplicationRunListener (2)、只需要放到ioc容器中即可 1.ApplicationRunner 2.CommandLineR 阅读全文
posted @ 2019-02-02 20:03 SpringCore 阅读(2472) 评论(0) 推荐(0) 编辑
摘要: (1)、添加依赖 (2)、编写实体类 (3)、配置Jpa (4)、编写一个Dao接口来操作实体类对应的数据表(Repository) 使用@PageableDefault注解控制默认的分页参数 相关测试及调用可以借鉴https://www.cnblogs.com/fanqisoft/p/103566 阅读全文
posted @ 2019-02-01 20:24 SpringCore 阅读(557) 评论(0) 推荐(0) 编辑
摘要: (1)、添加依赖 (2)、编写Mapper接口类 (3)、编写Mybatis配置文件 (4)、编写Mapper接口对应的Mapper配置文件 (5)、在配置文件中配置mybatis 阅读全文
posted @ 2019-02-01 20:06 SpringCore 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 详情可以参考Mybatis官方文档 http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/ (1)、引入Mybatis针对SpringBoot制作的Starter依赖 (2)、配置Mybatis设置 阅读全文
posted @ 2019-02-01 19:03 SpringCore 阅读(604) 评论(0) 推荐(0) 编辑
摘要: (1)、添加相关依赖 (2)、配置配置文件 (3)将配置文件自定义属性和自定义数据源绑定(我配置文件中没有自定义属性),配置Druid监控 (4)访问http://localhost:8080/druid 阅读全文
posted @ 2019-01-31 20:14 SpringCore 阅读(2370) 评论(0) 推荐(0) 编辑
摘要: (1)、添加相关依赖 (2)、在配置文件中配置数据源相关信息 (3)、编写service、dao(为了方便我就写在一起了) (4)controller调用即可 阅读全文
posted @ 2019-01-31 19:57 SpringCore 阅读(6518) 评论(0) 推荐(0) 编辑
摘要: SpringBoot默认使用嵌入式的Servlet容器,应用打包成可执行的jar包 优点:简单、便携 缺点:默认不支持jsp,优化定制比较复杂(使用定制器serverProperties、自定义EmbeddedServletContainerCustomizer,自己编写嵌入式Servlet容器的创 阅读全文
posted @ 2019-01-30 20:20 SpringCore 阅读(840) 评论(0) 推荐(0) 编辑
摘要: 1 2 org.springframework.boot 3 spring-boot-starter-web 4 5 6 7 org.springframework.boot 8 ... 阅读全文
posted @ 2019-01-29 20:55 SpringCore 阅读(536) 评论(0) 推荐(0) 编辑