Java:Spring框架:声明嵌套映射

前端之家收集整理的这篇文章主要介绍了Java:Spring框架:声明嵌套映射前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我在第4行收到错误说:
cvc-complex-type.2.4.d:从元素’map’开始发现无效内容.此时不会有子元素.

  

有什么建议?

最佳答案
对于复杂值类型,请不要嵌套map元素,而是使用value-ref属性.默认情况下,value元素仅接受String值.

The property may be a string,or may be converted to the required type using the JavaBeans PropertyEditor machinery. This makes it possible for application developers to write custom PropertyEditor implementations that can convert strings to arbitrary target objects.

Note that this is recommended for simple objects only. Configure more complex objects by populating JavaBean properties with references to other beans.

您的数据将类似于:

原文链接:https://www.f2er.com/spring/431578.html

猜你在找的Spring相关文章