小编Akc*_*ore的帖子

Spring Boot:将RequestParam中的defaultValue设置为application.properties中的值?

有没有办法将 defaultValue 设置为 application.properties 文件中的值?

@ResponseBody
public void test(@RequestParam(name="testValue", defaultValue = <something from application.properties>))
Run Code Online (Sandbox Code Playgroud)

java spring-boot

6
推荐指数
1
解决办法
1568
查看次数

不存在创建者:无法反序列化

我收到一个错误...(no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)这表明我需要一个基于财产的创建者。我有一些具有不同参数的构造函数,但没有默认值。

我的解决方案是添加一个默认构造函数SomeClass() {}。我的问题是:为什么会发生这种情况?另外,什么是基于委托/属性的构造函数?

spring-boot

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

spring-boot ×2

java ×1