有没有办法将 defaultValue 设置为 application.properties 文件中的值?
@ResponseBody
public void test(@RequestParam(name="testValue", defaultValue = <something from application.properties>))
Run Code Online (Sandbox Code Playgroud) 我收到一个错误...(no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)这表明我需要一个基于财产的创建者。我有一些具有不同参数的构造函数,但没有默认值。
我的解决方案是添加一个默认构造函数SomeClass() {}。我的问题是:为什么会发生这种情况?另外,什么是基于委托/属性的构造函数?