//分页获取用户信息
public void listUser2(ActionMapping 매핑, ActionForm 양식,
HttpServletRequest 요청, HttpServletResponse 응답){
RequestTool 도구 = new RequestTool(요청);
정수 pageSize = tool.getIntParameter("pageSize");
정수 pageIndex = tool.getIntParameter("pageIndex");
ResultPage res = serviceSmUserImpl.findAllSmUsers(pageIndex, pageSize);
목록
smUserList = (List)res.getResult();
JSONArray 배열 = 새로운 JSONArray();
JSONObject 개체 ;
for(SmUser user:smUserList){
object = new JSONObject();
object.put("userId", user.getUserId());
object.put("userName",user.getUserName());
object.put("depId", user.getOrganCode());
object.put("createTime", user.getCreateTime());
object.put("creator", user.getCreator());
object.put("menusId", user.getMenusId());
object.put("isValid", (user.getValid().equals("1")?"有效":"无效"));
array.add(객체);
}
AjaxTool.returnAjaxResponse(response, array.toJSONString());
}
//获取总的记录数和总页数
public void getPageCount(ActionMapping 매핑, ActionForm 양식,
HttpServletRequest 요청, HttpServletResponse 응답){
RequestTool 도구 = 새 RequestTool( 요구);
int pageSize = tool.getIntParameter("pageSize");
목록 pojos = serviceSmUserImpl.findAll();
int pageCount = pojos.size()% pageSize > 0? (pojos.size()/ pageSize 1):(pojos.size()/ pageSize);
JSONArray 배열 = 새 JSONArray();
JSONObject 개체 = 새 JSONObject();
object.put("pageCount", pageCount);
object.put("totalCount", pojos.size());
array.add(객체);
AjaxTool.returnAjaxResponse(response,array.toJSONString());
}