上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 41 下一页
摘要: 环境 spring boot 1.5.19 swagger-2.2.2 Swagger是一款RESTFUL接口的文档在线自动生成+功能测试功能软件 工具使用参考:Swagger使用指南 阅读全文
posted @ 2019-08-04 15:59 cac2020 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、Spring Boot Cache以及整合EhCacheSpring从3.1开始定义了org.springframework.cache.Cache和org.springframework.cache.CacheM 阅读全文
posted @ 2019-07-24 16:59 cac2020 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、打jar类型1、指定主程序入口,否则运行报错:没有主清单属性pom.xml: 2、打包 2、运行java -jar springboot-helloworld-0.0.1-SNAPSHOT.jar 二、打war类型 阅读全文
posted @ 2019-07-24 14:42 cac2020 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、自定义参数通过注解直接获取配置文件application.properties中配置key的value1、application.properties 2、注解取值 3、APP 4、测试验证:http://loca 阅读全文
posted @ 2019-07-24 10:50 cac2020 阅读(1740) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2一、定时任务1、启动类添加注解@EnableScheduling 用于开启定时任务 2、定义@Component定时组件类和@Scheduled定义执行周期 两种方式: (1)fixedDelay:示例:@Schedul 阅读全文
posted @ 2019-07-24 09:59 cac2020 阅读(1430) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、log4j 常见方式:log4j.properties + org.apache.log4j.Logger比如:log4j.properties: controller: 二、AOP 切面记录日志1、引入依赖 2、 阅读全文
posted @ 2019-07-23 18:30 cac2020 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、springboot整合事务事务分类:编程事务、声明事务(XML、注解),推荐使用注解方式,springboot默认集成事物,只主要在方法上加上@Transactional即可1、controller 2、serv 阅读全文
posted @ 2019-07-23 11:58 cac2020 阅读(1096) 评论(0) 推荐(0) 编辑
摘要: 环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一、Spring Boot整合Spring JDBC 1、pom.xml 2、controller 3、service impl: 4、APP.java 5、测试验证: http://localhost:8080/cr 阅读全文
posted @ 2019-07-22 11:05 cac2020 阅读(618) 评论(0) 推荐(0) 编辑
摘要: 环境 Java1.8 Spring Boot 1.3.2 一、静态资源访问 动静分离:动态服务和前台页面图片分开,静态资源可以使用CDN加速;Spring Boot默认提供静态资源目录位置需置于classpath下,目录名需符合如下规则:/static/public/resources /META- 阅读全文
posted @ 2019-07-15 17:34 cac2020 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 环境 Java1.8 Spring Boot 1.3.2 一、Spring Boot特点1、使用java运行项目,内置tomcat,无需外部容器;2、减少XML配置,使用properties文件和注解;3、Spring Boot对各个Spring技术进行了封装,并不是产生新技术,方便使用了Sprin 阅读全文
posted @ 2019-07-15 17:09 cac2020 阅读(269) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 41 下一页