web2020. 9. 18. 15:12

[web]pagenation 처리하는 방법 

 

size -> 10개씩 

page -> 현재 page index

 

 

int endPage = ((int)Math.ceil(page / (double)size)) * size;

int lastPage = ((int)Math.ceil(totalCount  / (double)size));

int beginPage = endPage - (size - 1);

 

// 마지막에 10개 밑일 경우 처리 

if (lastPage < endPage)

{

endPage = lastPage;

}

 

 

 

[참조 ]https://cbts.tistory.com/294

 

[JSP] 페이징(Paging) ① [11월28일]

(결과적으로 띄우고 싶은 화면!) 회원 리스트 밑에 페이지가 추가된 것을 볼 수 있음. 이번에 사용한 project의 모든 파일 일람표. 똑같은 내용에 프로젝트명만 L16Model2Paging으로 하면됩니다! 원래 ��

cbts.tistory.com

 

Posted by thdeodls85