-------controller中的代start-------@RequestMapping(value="/pages/system/getUsersBypagination.do")@ResponseBodypublicPagegetUsersBypagination(intpageNumber,intpageS...
-------controller中的代 start-------
@RequestMapping(value = "/pages/system/getUsersBypagination.do")
@ResponseBody
public Page getUsersBypagination(int pageNumber, int pageSize) {
Pageable pageable = new PageRequest(pageNumber, pageSize);
return usersService.findBypagination(pageable);
}
-------controller中的代 end-------
-------serivce中的代 start-------
@Service
public class UsersSerciceImp implements UsersService {
@Autowired
private UsersDao usersDao;
@Override
public Page findBypagination(Pageable pageable) {
Page pageUsers = usersDao.findAll(pageable);
return pageUsers;
}
}
-------serivce中的代 end-------
-------userdao中的代 start-------
public interface UsersDao extends JpaRepository {
public List findByusername(String username);
}
-------userdao中的代 end-------
查询结果:中content 为空
展开