spring boot + thymeleaf JPAなしデータベースなしでページング機能を実装したいです
こんにちはJAVAの初心者です。
今はspring bootの勉強をしています。
以下のデータを使ってthymeleafで簡単なページング機能を実装したいです。
インターネット上はJPAを用いてページング機能を実装する例が多くあるますが、
今回はJPAとDB使っていませんので、どのように簡単なページング機能を実装できますでしょうか?
ご教示お願い致します。
spring boot version = 2.0.4
thymeleaf version = 3.0.2
java version = Java8
@RequestMapping(path = "/find", method = { RequestMethod.GET, RequestMethod.POST })
public String find(AttendanceListForm form, Model model) {
AttendanceListDetail detail1 = new AttendanceListDetail();
detail1.setListChkBox("");
detail1.setOffice("1");
detail1.setAPayStructure("2");
detail1.setEmpNums("3");
detail1.setEmpName("4");
detail1.setAttendanceSheetRosterDays("5");
detail1.setAPaidVacations("6");
detail1.setCongratulationOrCondolenceLeave("7");
detail1.setOperationTime("8");
detail1.setOverTime("9");
detail1.setHolidayWorkTime("10");
detail1.setMoveTime("11");
detail1.setTotalWorkingTime("12");
detail1.setState("13");
AttendanceListDetail detail2 = new AttendanceListDetail();
detail2.setListChkBox("");
detail2.setOffice("1");
detail2.setAPayStructure("2");
detail2.setEmpNums("3");
detail2.setEmpName("4");
detail2.setAttendanceSheetRosterDays("5");
detail2.setAPaidVacations("6");
detail2.setCongratulationOrCondolenceLeave("7");
detail2.setOperationTime("8");
detail2.setOverTime("9");
detail2.setHolidayWorkTime("10");
detail2.setMoveTime("11");
detail2.setTotalWorkingTime("12");
detail2.setState("13");
AttendanceListDetail detail3 = new AttendanceListDetail();
detail3.setListChkBox("");
detail3.setOffice("1");
detail3.setAPayStructure("2");
detail3.setEmpNums("3");
detail3.setEmpName("4");
detail3.setAttendanceSheetRosterDays("5");
detail3.setAPaidVacations("6");
detail3.setCongratulationOrCondolenceLeave("7");
detail3.setOperationTime("8");
detail3.setOverTime("9");
detail3.setHolidayWorkTime("10");
detail3.setMoveTime("11");
detail3.setTotalWorkingTime("12");
detail3.setState("13");
AttendanceListDetail detail4 = new AttendanceListDetail();
detail4.setListChkBox("");
detail4.setOffice("1");
detail4.setAPayStructure("2");
detail4.setEmpNums("3");
detail4.setEmpName("4");
detail4.setAttendanceSheetRosterDays("5");
detail4.setAPaidVacations("6");
detail4.setCongratulationOrCondolenceLeave("7");
detail4.setOperationTime("8");
detail4.setOverTime("9");
detail4.setHolidayWorkTime("10");
detail4.setMoveTime("11");
detail4.setTotalWorkingTime("12");
detail4.setState("13");
AttendanceListDetail detail5 = new AttendanceListDetail();
detail5.setListChkBox("");
detail5.setOffice("1");
detail5.setAPayStructure("2");
detail5.setEmpNums("3");
detail5.setEmpName("4");
detail5.setAttendanceSheetRosterDays("5");
detail5.setAPaidVacations("6");
detail5.setCongratulationOrCondolenceLeave("7");
detail5.setOperationTime("8");
detail5.setOverTime("9");
detail5.setHolidayWorkTime("10");
detail5.setMoveTime("11");
detail5.setTotalWorkingTime("12");
detail5.setState("13");
AttendanceListDetail detail6 = new AttendanceListDetail();
detail6.setListChkBox("");
detail6.setOffice("1");
detail6.setAPayStructure("2");
detail6.setEmpNums("3");
detail6.setEmpName("4");
detail6.setAttendanceSheetRosterDays("5");
detail6.setAPaidVacations("6");
detail6.setCongratulationOrCondolenceLeave("7");
detail6.setOperationTime("8");
detail6.setOverTime("9");
detail6.setHolidayWorkTime("10");
detail6.setMoveTime("11");
detail6.setTotalWorkingTime("12");
detail6.setState("13");
AttendanceListDetail detail7 = new AttendanceListDetail();
detail7.setListChkBox("");
detail7.setOffice("1");
detail7.setAPayStructure("2");
detail7.setEmpNums("3");
detail7.setEmpName("4");
detail7.setAttendanceSheetRosterDays("5");
detail7.setAPaidVacations("6");
detail7.setCongratulationOrCondolenceLeave("7");
detail7.setOperationTime("8");
detail7.setOverTime("9");
detail7.setHolidayWorkTime("10");
detail7.setMoveTime("11");
detail7.setTotalWorkingTime("12");
detail7.setState("13");
AttendanceListDetail detail8 = new AttendanceListDetail();
detail8.setListChkBox("");
detail8.setOffice("1");
detail8.setAPayStructure("2");
detail8.setEmpNums("3");
detail8.setEmpName("4");
detail8.setAttendanceSheetRosterDays("5");
detail8.setAPaidVacations("6");
detail8.setCongratulationOrCondolenceLeave("7");
detail8.setOperationTime("8");
detail8.setOverTime("9");
detail8.setHolidayWorkTime("10");
detail8.setMoveTime("11");
detail8.setTotalWorkingTime("12");
detail8.setState("13");
AttendanceListDetail detail9 = new AttendanceListDetail();
detail9.setListChkBox("");
detail9.setOffice("1");
detail9.setAPayStructure("2");
detail9.setEmpNums("3");
detail9.setEmpName("4");
detail9.setAttendanceSheetRosterDays("5");
detail9.setAPaidVacations("6");
detail9.setCongratulationOrCondolenceLeave("7");
detail9.setOperationTime("8");
detail9.setOverTime("9");
detail9.setHolidayWorkTime("10");
detail9.setMoveTime("11");
detail9.setTotalWorkingTime("12");
detail9.setState("13");
AttendanceListDetail detail10 = new AttendanceListDetail();
detail10.setListChkBox("");
detail10.setOffice("1");
detail10.setAPayStructure("2");
detail10.setEmpNums("3");
detail10.setEmpName("4");
detail10.setAttendanceSheetRosterDays("5");
detail10.setAPaidVacations("6");
detail10.setCongratulationOrCondolenceLeave("7");
detail10.setOperationTime("8");
detail10.setOverTime("9");
detail10.setHolidayWorkTime("10");
detail10.setMoveTime("11");
detail10.setTotalWorkingTime("12");
detail10.setState("13");
AttendanceListDetail detail11 = new AttendanceListDetail();
detail11.setListChkBox("");
detail11.setOffice("1");
detail11.setAPayStructure("2");
detail11.setEmpNums("3");
detail11.setEmpName("4");
detail11.setAttendanceSheetRosterDays("5");
detail11.setAPaidVacations("6");
detail11.setCongratulationOrCondolenceLeave("7");
detail11.setOperationTime("8");
detail11.setOverTime("9");
detail11.setHolidayWorkTime("10");
detail11.setMoveTime("11");
detail11.setTotalWorkingTime("12");
detail11.setState("13");
AttendanceListDetail detail12 = new AttendanceListDetail();
detail12.setListChkBox("");
detail12.setOffice("1");
detail12.setAPayStructure("2");
detail12.setEmpNums("3");
detail12.setEmpName("4");
detail12.setAttendanceSheetRosterDays("5");
detail12.setAPaidVacations("6");
detail12.setCongratulationOrCondolenceLeave("7");
detail12.setOperationTime("8");
detail12.setOverTime("9");
detail12.setHolidayWorkTime("10");
detail12.setMoveTime("11");
detail12.setTotalWorkingTime("12");
detail12.setState("13");
AttendanceListDetail detail13 = new AttendanceListDetail();
detail13.setListChkBox("");
detail13.setOffice("1");
detail13.setAPayStructure("2");
detail13.setEmpNums("3");
detail13.setEmpName("4");
detail13.setAttendanceSheetRosterDays("5");
detail13.setAPaidVacations("6");
detail13.setCongratulationOrCondolenceLeave("7");
detail13.setOperationTime("8");
detail13.setOverTime("9");
detail13.setHolidayWorkTime("10");
detail13.setMoveTime("11");
detail13.setTotalWorkingTime("12");
detail13.setState("13");
AttendanceListDetail detail14 = new AttendanceListDetail();
detail14.setListChkBox("");
detail14.setOffice("1");
detail14.setAPayStructure("2");
detail14.setEmpNums("3");
detail14.setEmpName("4");
detail14.setAttendanceSheetRosterDays("5");
detail14.setAPaidVacations("6");
detail14.setCongratulationOrCondolenceLeave("7");
detail14.setOperationTime("8");
detail14.setOverTime("9");
detail14.setHolidayWorkTime("10");
detail14.setMoveTime("11");
detail14.setTotalWorkingTime("12");
detail14.setState("13");
List<AttendanceListDetail> detailList = new ArrayList<>();
detailList.add(detail1);
detailList.add(detail2);
detailList.add(detail3);
detailList.add(detail4);
detailList.add(detail5);
detailList.add(detail6);
detailList.add(detail7);
detailList.add(detail8);
detailList.add(detail9);
detailList.add(detail10);
detailList.add(detail11);
detailList.add(detail12);
detailList.add(detail13);
detailList.add(detail14);
form.setAttendanceListDetail(detailList);
model.addAttribute("areaListItems", areaListItems());
model.addAttribute("salesOffice", salesOffice());
model.addAttribute("listDisplayer", listDisplayer());
model.addAttribute("attendanceListForm", form);
return "views/attendance/attendanceList";
}
thymeleaf
<div class="container-fluid" id="pager">
<div class="form-group">
<div class="col-xs-7">
<div class="row">
<div class="col-xs-2 text-left">
<label class="control-label">1~30 / 100</label>
</div>
<div class="col-xs-10">
<div class="btn-group pull-left">
<button type="button" class="btn btn-link">
<span class="glyphicon glyphicon-fast-backward"></span>
</button>
<button type="button" class="btn btn-link">
<span class="glyphicon glyphicon-backward"></span>
</button>
<button type="button" class="btn btn-link">1</button>
<button type="button" class="btn btn-link">2</button>
<button type="button" class="btn btn-link">3</button>
<button type="button" class="btn btn-link">4</button>
<button type="button" class="btn btn-link">5</button>
<button type="button" class="btn btn-link">
<span class="glyphicon glyphicon-forward"></span>
</button>
<button type="button" class="btn btn-link">
<span class="glyphicon glyphicon-fast-forward"></span>
</button>
</div>
</div>
</div>
</div>