同时,在action中定义type,在调用的函数处获取。
1 private String type; 2 public String getType() { 3 return type; 4 } 5 6 public void setType(String type) { 7 this.type = type; 8 } 9 10 /**11 * 显示表格信息12 * @return13 */14 public String toTable(){15 try {16 HttpServletRequest request = ServletActionContext.getRequest();17 JSONArray jsonParam = JSONArray.fromObject(request.getParameter("aoData"));18 //也可以通过request获取参数 /** String type = request.getParameter("type").toString(); **/ 19 for(int i=0;ils = service.searchPageUser(iDisplayStart,iDisplayLength,type);44 JSONArray arr = JSONArray.fromObject(ls);45 resultJson.put("aaData", arr);46 resultJson.put("iTotalRecords", count);47 resultJson.put("iTotalDisplayRecords", count);48 } catch (Exception e1) {49 e1.printStackTrace();50 } 51 52 return "toTable";53 }