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

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

  java.lang.Boolean">
                                     

有什么建议?

最佳答案
对于复杂值类型,请不要嵌套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.

您的数据将类似于:

java.lang.Boolean">
    java.lang.Boolean">
    

相关文章

这篇文章主要介绍了spring的事务传播属性REQUIRED_NESTED的原...
今天小编给大家分享的是一文解析spring中事务的传播机制,相...
这篇文章主要介绍了SpringCloudAlibaba和SpringCloud有什么区...
本篇文章和大家了解一下SpringCloud整合XXL-Job的几个步骤。...
本篇文章和大家了解一下Spring延迟初始化会遇到什么问题。有...
这篇文章主要介绍了怎么使用Spring提供的不同缓存注解实现缓...