微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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">
    

原文地址:https://www.jb51.cc/spring/431578.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐