MCPcopy Index your code
hub / github.com/castello/spring_basic / doPaging

Method doPaging

ch4/PageHandler.java:34–41  ·  view source on GitHub ↗
(int totalCnt, SearchCondition sc)

Source from the content-addressed store, hash-verified

32 }
33
34 private void doPaging(int totalCnt, SearchCondition sc) {
35 this.totalPage = totalCnt / sc.getPageSize() + (totalCnt % sc.getPageSize()==0? 0:1);
36 this.sc.setPage(Math.min(sc.getPage(), totalPage)); // page가 totalPage보다 크지 않게
37 this.beginPage = (this.sc.getPage() -1) / NAV_SIZE * NAV_SIZE + 1; // 11 -> 11, 10 -> 1, 15->11. 따로 떼어내서 테스트
38 this.endPage = Math.min(beginPage + NAV_SIZE - 1, totalPage);
39 this.showPrev = beginPage!=1;
40 this.showNext = endPage!=totalPage;
41 }
42
43 public String getQueryString() {
44 return getQueryString(this.sc.getPage());

Callers 1

PageHandlerMethod · 0.95

Calls 3

getPageSizeMethod · 0.80
setPageMethod · 0.80
getPageMethod · 0.65

Tested by

no test coverage detected