You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSDTO请求中Map类型属性映射为空的问题求助

WSDTO请求中Map类型属性映射为空的问题求助

各位大佬好,我遇到一个WSDTO属性映射的问题,想请教下大家:

我定义的WSDTO结构大致如下:

<bean class="xyz.dto.MyOrderWsDTO"> 
  <property name="code" type="java.lang.String" /> 
  <property name="additionalInformation" type="java.util.Map&lt;String,String&gt;"/> 
</bean>

现在我在控制器里期望接收MyOrderWsDTO作为请求体,传递的JSON是这样的:

{ "code": "abc", "additionalInformation": [ { "xyz": "hhj", "def": "value" } ] }

目前code字段能正常映射到值,但additionalInformation始终是null,我原本期望这个Map里能拿到这样的键值对:

  • xyz: hhj
  • def: value

有没有大佬能帮我看看问题出在哪呀?

备注:内容来源于stack exchange,提问作者Kaushiki Singh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 07:13:02