控制层

@RequestMapping("list")
    // 如果访问此访问:则路径为:user/list.do
    public String list(HttpServletRequest request) {
        String page = request.getParameter("currentPage") == null ? "1"
                : request.getParameter("currentPage");
        String queryname = request.getParameter("queryname") == null ? ""
                : request.getParameter("queryname");
        String querymoney = (request.getParameter("querymoney") == null || request
                .getParameter("querymoney") == "") ? "0" : request
                .getParameter("querymoney");
        float money = Float.parseFloat(querymoney);
        int currentPage = Integer.parseInt(page);
        Map map=new HashMap();
        map.put("name", queryname);
        map.put("money", money);
        map.put("start", (currentPage-1)* PageSize.PAGESIZE);
        map.put("end", PageSize.PAGESIZE);
        List listPage = db.listPage(map);
        request.setAttribute("list", listPage);// 存起来
        int dataCount = (int) db.getUserCount(map);
        PageUtils.page(request, currentPage, PageSize.PAGESIZE, listPage,
                dataCount);
        return "list";
    }

你可能感兴趣的:(控制层)