为懒人提供无限可能,生命不息,code不止
作者: whooyun发表于: 2017-03-16 01:52
@RequestMapping("/index") public String index(HttpServletRequest req,Model model) { if (null != req.getParameter("currentIndex") && "" != req.getParameter("currentIndex").trim()) { currentIndex = Integer.parseInt(req.getParameter("currentIndex")); } HashMap<String, Integer> map = new HashMap<String, Integer>(); if (currentIndex == 1) { map.put("begin_num", 1); } else { map.put("begin_num", (currentIndex - 1) * PAGESIZE); } map.put("end_num", 10); List<Article> articleList = articleService.searchAllArticles(map); PageVO page = new PageVO(); page.setDataObj(articleList); page.setPageSize(PAGESIZE); page.setTotal(articleService.countArticles()); page.setCurrentIndex(currentIndex); logger.info(articleList.get(0).getArticleContent()); model.addAttribute("page", page); //model.addAttribute("headMenu", CommonConstantDef.HEAD_MENU_DUANZI); return "duanzi/index"; }