Coin163

首页 > spring mvc 结合easyui datagrid 使用responseBody 注解 返回json 无法绑定

spring mvc 结合easyui datagrid 使用responseBody 注解 返回json 无法绑定

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1074

【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址https://www.aliyun.com/1111/home

今天遇到了这个问题,o(︶︿︶)o 唉,究其原因,太长时间不用easyui了。都忘记怎么用了。 使用 easyui datagrid表格,返回的日期要符合 要求的格式。 给出一份easyui 官方的demo数据格式: {"total":28,"rows":[ {"productid":"FI-SW-01","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, {"productid":"K9-DL-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":28.50,"attr1":"Venomless","itemid":"EST-11"}, {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, {"productid":"RP-LI-02","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":63.50,"attr1":"Adult Female","itemid":"EST-16"}, {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, {"productid":"AV-CB-01","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} ]} 我们要输出这样的格式其实也不难。使用spring mvc 容易就做到了。 public @ResponseBody Map<String, Object>findall(int page,int rows) {

List<Logininfo> logininfos = logininfoBiz.searchAll(page,rows);//访问数据层,得到数据

int count=logininfoBiz.searchCount();//访问数据层 得到总数量

Map<String, Object> map = new HashMap<String, Object>();

map.put("rows", logininfos);

map.put("total", count);

return map;

} 介绍完毕,如有问题,请留言交流。

原文

今天遇到了这个问题,o(︶︿︶)o 唉,究其原因,太长时间不用easyui了。都忘记怎么用了。 使用 easyui datagrid表格,返回的日期要符合 要求的格式。 给出一份easyui 官方的demo数据格式: {"t

------分隔线----------------------------
相关推荐