有没有办法为使用@Value注释的模型下的字段提供默认值。例如:class Book { List<String> authors;在上面的模型中,Jackson将authors从json有效负载反序列化为null,将authors设置为null,但我希望author使用[]作为默认值,而不是null。
我正在尝试将json数据提交给使用模型映射的Spring控制器。模型的字段的值都为NULL,而不是获取json值。
例外:
org.springframework.dao.InvalidDataAccessApiUsageException: The given id must not be null; nested exception is java.lang.IllegalArgumentException: The given id must n