
SpringBoot
禅与计算机程序设计艺术
这个作者很懒,什么都没留下…
展开
-
jackson 序列化忽略未知字段: How to Ignore Unknown Properties While Parsing JSON in Java
One of the common problem while parsing JSON in Java using Jackson API is that it fails when your JSON contains unknown properties i.e. your Java class doesn't have all the field corresponding to all JSON properties.使用 Jackson API 在Java中解析JSON时的一个常见问题是.原创 2021-07-20 10:35:21 · 727 阅读 · 0 评论 -
《Kotin 极简教程》第11章 使用Kotlin 集成 SpringBoot开发Web服务端
第11章 使用Kotlin集成SpringBoot开发Web服务端我们在前面第2章 “ 2.3 Web RESTFul HelloWorld ” 一节中,已经介绍了使用 Kotlin 结合 SpringBoot 开发一个RESTFul版本的 Hello World。当然,Kotlin与Spring家族的关系不止如此。在 Spring 5.0 M4 中引入了一个专门针对Kotlin的支持。本章我们就一起来学习怎样使用Kotlin集成SpringBoot、SpringMVC等框架来开发Web服务端应用,同时原创 2020-09-18 17:14:36 · 898 阅读 · 1 评论 -
Kotlin instance variable is null when accessed by Spring proxied class
QuestionI have a service class that is being proxied by Spring, like so:@Service@Transactionalopen class MyService { ... }If I remove the open modifier, Spring complains that it needs to proxy the class to apply the @Transactional annotation tweaks.原创 2020-09-11 16:40:21 · 193 阅读 · 0 评论 -
解决 Spring HttpMessageConverter 解析多余属性出错问题:DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
例如,使用注解: @RequestBody Query query 。MappingJackson2HttpMessageConverter 如何忽略 Query 入参对象未知属性?import com.fasterxml.jackson.databind.DeserializationFeature;import com.fasterxml.jackson.databind.ObjectMapper;import com.fasterxml.jackson.databind.module.Simp原创 2020-08-18 14:32:01 · 1547 阅读 · 0 评论 -
注意使用: WebMvcConfigurerAdapter 和 WebMvcConfigurationSupport 的 坑
SpringBoot2.x中 WebMvcConfigurerAdapter 已过时,使用WebMvcConfigurationSupport 替换时自动配置失效。Spring Boot的WebMvc自动配置失效了,我们访问不到静态资源(js,css等)了,然后查找资料发现,这是因为WebMvc的自动配置都在WebMvcAutoConfiguration类中,@Configuration@ConditionalOnWebApplication( type = Type.SERVLET)@C原创 2020-08-17 21:01:42 · 784 阅读 · 0 评论 -
Spring Boot @EnableWebMvc 配置Long类型精度丢失, supportedMediaType 支持,addResourceHandlers配置;添加拦截器
import com.fasterxml.jackson.databind.ObjectMapper;import com.fasterxml.jackson.databind.module.SimpleModule;import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;import org.springframework.context.annotation.Configuration;import org.springf原创 2020-08-17 20:25:59 · 368 阅读 · 0 评论 -
Spring Boot 处理 Long 类型的 json 数据,前端调用精度丢失,变成 00
问题描述错误的ID,最后两位数都是0,即:1152921504735848700,但是,正确的是:1152921504735848759,遇到Long类型的数据,传送给前端遇到精度丢失的问题.后端的订单号值比如1089713253179727872 传给前端 显示出来是1089713253179727900。拿postman测试接口没有问题,查到的是正确的数据,原来是因为Long类型数据传给前端可能精度丢失,js中的数据类型不能包含所有的java long值。这个问题真是在前后端连接的夹缝中原创 2020-08-14 18:04:39 · 2132 阅读 · 4 评论 -
Springboot问题解决:javax.servlet.ServletException: Circular view path [login]: would dispatch...
javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecifi...原创 2017-09-13 14:26:08 · 46034 阅读 · 0 评论 -
React.js 集成 Kotlin Spring Boot 开发 Web 应用实例详解
React.js 集成 Kotlin Spring Boot 开发 Web 应用实例详解项目工程目录~/easykotlin/reakt$ tree.├── build│ ├── kotlin│ │ ├── compileKotlin│ │ └── compileTestKotlin│ └── kotlin-build│ └── version.原创 2017-12-17 01:27:46 · 1512 阅读 · 0 评论 -
《Kotlin极简教程》第七章 Kotlin 集成 Springboot开发WebApp
本章请参考:最新上架!!!《 Kotlin极简教程》 陈光剑 (机械工业出版社):https://mp.weixin.qq.com/s/bzRkGSO6T1O2AELM_UqKUQ《Springboot极简教程》第二章 使用Spring Boot, JPA, Mysql, ThymeLeaf,gradle, Kotlin快速构建一个CRUD Web App原创 2017-09-13 14:24:26 · 607 阅读 · 0 评论 -
《Springboot极简教程》使用Spring Boot, JPA, Mysql, ThymeLeaf,gradle, Kotlin快速构建一个CRUD Web App
使用Spring Boot, JPA, Mysql, ThymeLeaf,gradle, Kotlin快速构建一个CRUD Web AppThymeleaf is a modern server-side Java template engine for both web and standalone environments.Thymeleaf's main goal is to brin原创 2017-09-13 14:24:06 · 1392 阅读 · 0 评论 -
Spring Boot 集成日志 logging sl4j
Spring Boot 集成日志 logging sl4j1.配置:src/main/resources/application.propertieslogging.config=classpath:logback-spring.xmllogback-spring.xml ${APP_NAME}原创 2017-09-13 14:36:56 · 644 阅读 · 0 评论