springboot
乌龟壳
爬的慢,飞的快
展开
-
springboot之前后端传参类型比较
在实际的项目开发中,后台controller方法可能有各种数据类型的参数接收前端传递的值,比如8种基本数据类型、对象、集合等。有的时候,前端不知道使用什么形式的传参,比如key-value或raw(json或数组)。为了系统的学习和运用,本文对各种类型的情况作了实验,记录各种结果。本文并不会介绍原理,只为记录实验结果。...原创 2018-11-30 16:25:04 · 1507 阅读 · 0 评论 -
记mybatis查询null字段导致的NPE
背景:我们在写sql语句时,不推荐使用select *的,所以我们只需要查询出我们需要的字段值就可以了。但是,如果查询的某几个字段值都是null,我们使用list接收的话,那么list中的对象就是null,引起NPE问题。分析:查看mybatis处理查询结果的源码,主要是将结果封装成对象getRowValue就是把每行的结果封装成对象返回。其中有一个方法是applyAutomaticM...原创 2019-01-30 15:30:36 · 1650 阅读 · 0 评论 -
SpringBoot之@ComponentScan和@SpringBootApplication扫描覆盖问题
@SpringBootApplication=@Configuration+@EnableAutoConfiguration+@ComponentScan,其中扫描包的范围为启动类所在包和子包,不包括第三方的jar包。如果我们需要扫描通过maven依赖添加的jar,我们就要单独使用@ComponentScan注解扫描第三方包。但是,如果@SpringBootApplication和@Compon...原创 2019-02-26 15:27:50 · 24105 阅读 · 5 评论 -
The bean 'redisTemplate' could not be injected as a 'org.springframework.data.redis.core.RedisTempla
使用springboot集成redis的时候,启动项目报错:The bean 'redisTemplate' could not be injected as a 'org.springframework.data.redis.core.RedisTemplate' because it is a JDK dynamic proxy that implements: org.springfra...原创 2019-03-09 13:37:23 · 1296 阅读 · 0 评论