fix the pagination in JSP & servlets
remove code duplicate
tech commit