随笔分类 -  springboot学习日记

摘要:springboot默认使用Logback来记录日志,且默认是只打印到控制台中,不会输出到文件。需要输出到文件中,只需要在配置文件application.properties中加上一句:loggin.file = xxx 即可。可以使用相对路径或者绝对路径。 logging.file=../logs 阅读全文
posted @ 2019-06-25 11:24 小丽的小明 阅读(453) 评论(0) 推荐(0)
摘要:springboot整合redis相关依赖引入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> 阅读全文
posted @ 2019-06-06 15:35 小丽的小明 阅读(190) 评论(0) 推荐(0)
摘要:1、使用starter, maven仓库地址:http://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter 2、加入依赖(可以用 http://start.spring.io/ 下载) <! 阅读全文
posted @ 2019-05-29 11:08 小丽的小明 阅读(319) 评论(0) 推荐(0)
摘要:Springboot整合freemarker1、Freemarker相关maven依赖 <!-- 引入freemarker模板引擎的依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-b 阅读全文
posted @ 2019-05-22 17:41 小丽的小明 阅读(389) 评论(0) 推荐(0)
摘要:SpringBoot2.x过滤器Filter和使用Servlet3.0配置自定义Filter1、SpringBoot启动默认加载的Filter characterEncodingFilter hiddenHttpMethodFilter httpPutFormContentFilter reques 阅读全文
posted @ 2019-05-22 11:35 小丽的小明 阅读(160) 评论(0) 推荐(0)
摘要:springboot @SpringBootTest单元测试 1、引入相关依赖 <!--springboot程序测试依赖,如果是自动创建项目默认添加--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spr 阅读全文
posted @ 2019-05-20 14:18 小丽的小明 阅读(1918) 评论(0) 推荐(0)
摘要:SpringBoot2.x使用Dev-tool热部署 简介:介绍什么是热部署,使用springboot结合dev-tool工具,快速加载启动应用 官方地址:https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/reference/h 阅读全文
posted @ 2019-05-20 09:45 小丽的小明 阅读(720) 评论(0) 推荐(0)
摘要:MultipartFile 对象的transferTo方法,用于文件保存(效率和操作比原先用FileOutStream方便和高效) 打包成jar包,需要增加maven依赖 <build> <plugins> <plugin> <groupId>org.springframework.boot</gr 阅读全文
posted @ 2019-05-17 09:45 小丽的小明 阅读(2687) 评论(0) 推荐(0)
摘要:Jackson常用注解: 指定字段不返回:@JsonIgnore 指定日期格式:@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",locale="zh",timezone="GMT+8") 空字段不返回:@JsonInclude(Include.NON_NUll) 阅读全文
posted @ 2019-05-16 15:41 小丽的小明 阅读(877) 评论(0) 推荐(0)
摘要:1.Get请求 1)测试restful协议,从路径中获取字段 单一参数@RequestMapping(path = "/{id}", method = RequestMethod.GET) public String getUser(@PathVariable String id ) {} 2)测试 阅读全文
posted @ 2019-05-16 14:53 小丽的小明 阅读(1161) 评论(0) 推荐(0)