06 2022 档案
摘要:依赖处理 先排除Tomcat依赖 ,然后引入undertow依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions
阅读全文
摘要:Unable to render this definition The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version fi
阅读全文
摘要:有时候我们前端参数名称用的下划线,但是后台接收一般都用驼峰命名,这样就会导致前端参数无法接收到问题 加个配置 spring: jackson: property-naming-strategy: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES 这样就会自动转换接收
阅读全文
摘要:我们使用 JSON.toJSONString(list); 这种方式 如果字段为空,是不会进行序列化的 如果要序列化空值的话 使用 JSON.toJSONString(list, SerializerFeature.WriteMapNullValue); 其他一些方法 SerializerFeatu
阅读全文
摘要:import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework
阅读全文
摘要:有时候我们给所有页面都显示站点信息,可以直接全局配置ModelMap信息 然后页面就可以直接获取 GlobalConfig.java import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotat
阅读全文
摘要:<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> 自定义序列化配置 DemoJsonAdapter.java import com.google.gson.
阅读全文