spring mvc:实现给Controller函数传入map参数

【1】前端js调用示例:

...fillOrDiffer?inMapJson={"2016-08-31 0:00:00":0.1,"2016-08-31 0:15:00":0.15,"2016-08-31 0:30:00":0.2}

【2】Controller层函数接收:

Map<String, Object> inMap=new LinkedHashMap<String, Object>(); 

inMap = JsonUtil.toMap(inMapJson); //将json字符串转换为map

【3】注意:Controller层引入jar包

         import com.faj.common.utils.json.JsonUtil;

原文地址:https://www.cnblogs.com/lj821022/p/6142008.html