用Spring MVC 拼接一個json數據(測試json數據正常),主要代碼如下:
@RequestMapping(value = "/saleout/precheck", method = RequestMethod.GET)
public @ResponseBody ModelAndView precheckStoreInForm(HttpServletRequest request,SaleOut saleout , Map<String,Object> map,PageInfo sopg){
ModelAndView mav = new ModelAndView("/saleOut/searchSaleoutResults");
....(邏輯省略)
List ls=new ArrayList();
for(SaleOut s:results){
ls.add(s);
}
JSONArray jsonArray = JSONArray.fromObject(ls);
logger.info("test>>>>>>>>>>>"+jsonArray);
//打印json數據正常
map.put("selectResults", jsonArray);
mav.addAllObjects(map);
return mav;
在頁面中直接引入EasyUI的Basic DataGrid
問題出在:
data-options="singleSelect:true,collapsible:true,url:'/store/saleout/precheck/',method:'get'">
class="easyui-datagrid"有?
/store/saleout/precheck/ ?這個後面多個/,/store/saleout/precheck,是相對路徑,具體的看你的實際情況