
springboot
yandao
“我是谁”、“我在哪”、“我要去哪儿”
展开
-
springboot开发中遇到的error
1.mapper.xml的配置 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.web.music.dao.AdminMapper.verifyPassword at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.5.jar:3.5.原创 2020-11-10 22:39:21 · 432 阅读 · 0 评论 -
JsonSerialize时间数据转换解决方案
比如在返回的json数据中想要得到一个long类型的数据: 后来发现json中得到的数据是: 解决方案: 步骤一: 重写JsonSerializer方法 public class Date2LongSerializer extends JsonSerializer<Date> { @Override public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerPr原创 2020-11-09 13:16:10 · 468 阅读 · 0 评论 -
JsonSerialize.Inclusion @Deprecated的解决方案
Json默认是包含空串的,如果我们不想让json返回null值,可以在bean上添加一些注解。 /** @deprecated */ @Deprecated public static enum Inclusion { ALWAYS, NON_NULL, NON_DEFAULT, NON_EMPTY, DEFAULT_INCLUSION; private Inclusion() { } } 例如 @JsonSerialize(using原创 2020-11-09 13:09:09 · 1337 阅读 · 0 评论 -
springboot banner定制
Spring Boot在启动的时候会有一个默认的启动图案: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|=====原创 2020-09-01 10:14:42 · 102 阅读 · 0 评论 -
@Controller 区别于 @RestController
Controller, RestController的共同点 都是用来表示Spring某个类的是否可以接收HTTP请求 2. Controller, RestController的不同点 @zhiController标识一个daoSpring类是Spring MVC controller处理器 @RestController: a convenience annotation that does nothing more than adding the@Controller and@Response.原创 2020-09-01 09:53:08 · 141 阅读 · 0 评论