Beispiel #1
0
 /**
  * 更改
  *
  * @throws IOException
  */
 @Action(value = "editNick")
 public void editNick() throws IOException {
   String nickId = request.getParameter("nickId");
   if (nickId != null) {
     nickService.update(Integer.parseInt(nickId));
     response.getWriter().print(true);
   } else {
     response.getWriter().print(false);
   }
   response.getWriter().close();
 }
Beispiel #2
0
 /** 待审核 */
 @Action(value = "findNew")
 public String findNew() {
   response.setContentType("text/html");
   int page = 1; // 默认是返回第一页数据,当前页
   int pageSize = 10; // 页面大小,每页数据条数
   String pageStr = request.getParameter("page");
   if (pageStr != null) {
     page = Integer.parseInt(pageStr); // 获取页码
   }
   int total = nickService.findTotal("F"); // 获取总条数
   int totalPage = total / pageSize; // 计算总页码
   if (total % pageSize > 0) {
     totalPage++;
   }
   List<Nick> list = new ArrayList<Nick>();
   List pList = new ArrayList();
   list = nickService.findAll(page, pageSize, "F"); // 获取结果集
   pList = PageUtil.pageTools(totalPage, pageSize); // 获得分页信息
   request.setAttribute("page", page);
   request.setAttribute("totalPage", totalPage);
   request.setAttribute("list", list);
   request.setAttribute("pList", pList);
   return "new_success";
 }