Java高级架构师(一)第15节:带查询的分页、修改和删除页面
@RequestMapping(value="toList",method=RequestMethod.GET) public String toList(@ModelAttribute("wm")CustomerWebModel wm,Model model){ CustomerQueryModel cqm = null; if(wm.getQueryJsonStr()==null || wm.getQueryJsonStr().trim().length()==0){ cqm = new CustomerQueryModel(); }else{ cqm = (CustomerQueryModel)JsonHelper.str2Object(wm.getQueryJsonStr(), CustomerQueryModel.class); } cqm.getPage().setNowPage(wm.getNowPage()); if(wm.getPageShow() > 0){ cqm.getPage().setPageShow(wm.getPageShow()); } Page dbPage = ics.getByConditionPage(cqm); // System.out.println(wm); System.out.println(dbPage); model.addAttribute("wm", wm); model.addAttribute("page", dbPage); return "customer/list"; }