
SpringBoot学习
骑龟的狗
菜的抠脚
展开
-
SpringBoot配置全局异常学习笔记
1.在未配置全局异常之前:访问一个出现异常的接口 @GetMapping("/testJson") Object testJson(){ int a = 1 /0 ; return new User("wjl12333",11,"13563986965",new Date(),"10010"); } 浏览器中访问/testJson返回接口如图所示: 2. ...原创 2020-06-03 09:51:42 · 240 阅读 · 0 评论 -
SpringBoot2.3.0-application默认配置
Spring官网查看地址: https://docs.spring.io/spring-boot/docs/2.3.0.RELEASE/reference/html/appendix-application-properties.html#core-properties转载 2020-05-25 15:15:41 · 564 阅读 · 0 评论 -
Jackson处理Json格式相关注解学习
1.指定字段不返回:@JsonIgnore 2.指定日期格式:@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",locale="zh",timezone="GMT+8") 3.空字段不返回:@JsonInclude(Include.NON_NULL) 4.指定别名:@JsonProperty 测试: SimpleController: @GetMapping("/testJson") Object testJson(){ return原创 2020-05-25 11:26:18 · 268 阅读 · 0 评论