Spring 分页查询

Pageable pageable = PageRequest.of(2,2);    //第一个2表示从第几页开始,第二个2表示显示几条
Page<User> pages= userDao.findAll(pageable);
model.addAttribute("users",pages);
return "list-user"

  

猜你喜欢

转载自www.cnblogs.com/max-hou/p/12111224.html
今日推荐