码迷,mamicode.com
首页 > 其他好文 > 详细

SpingBoot-Thymeleaf-bootstrapTable-分页之Controller

时间:2018-04-25 19:01:25      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:Springboot

JAVA

@RequestMapping(value = "/user-list", method = { RequestMethod.POST })
    public String userList(Model model, @RequestParam(value = "models", required = false) String models) {
        Map searchParameters = new HashMap();
        if (models != null && models.length() > 0) {
            try {
                searchParameters = objectMapper.readValue(models, new TypeReference<Map>() {
                });
            } catch (JsonParseException e) {
                log.error("JsonParseException{}:", e.getMessage());
            } catch (JsonMappingException e) {
                log.error("JsonMappingException{}:", e.getMessage());
            } catch (IOException e) {
                log.error("IOException{}:", e.getMessage());
            }
        }
        Map map = userService.getPage(searchParameters, salt);
        // 用户表格数据
        model.addAttribute("list", map.get("users"));
        // 总条数
        model.addAttribute("total", map.get("total"));
        return "sys/user-list";
    }

SpingBoot-Thymeleaf-bootstrapTable-分页之Controller

标签:Springboot

原文地址:http://blog.51cto.com/360douruanliang/2107780

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!