map不能存储list
来源:4-10 店铺注册之js实现
慕数据7179807
2019-08-20
我和老师你的一样为什么我的list存储在map里面返回给后台就不会显示呢


写回答
1回答
-
突出部作战
2019-08-20
貌似你没有<>里标识好类型,可以看看我的,我的没问题
@RequestMapping(value = "/getshopinitinfo", method = RequestMethod.GET) @ResponseBody private Map<String, Object> getShopInitInfo() { Map<String, Object> modelMap = new HashMap<String, Object>(); List<ShopCategory> shopCategoryList = new ArrayList<ShopCategory>(); List<Area> areaList = new ArrayList<Area>(); try { shopCategoryList = shopCategoryService.getShopCategoryList(new ShopCategory()); areaList = areaService.getAreaList(); modelMap.put("shopCategoryList", shopCategoryList); modelMap.put("areaList", areaList); modelMap.put("success", true); } catch (Exception e) { modelMap.put("success", false); modelMap.put("errMsg", e.getMessage()); } return modelMap; }112019-08-20
相似问题