Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Thúy- fix bug 154 (Completed)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhtnguyen committed Mar 6, 2024
1 parent 5483afb commit e000fc5
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
int pageSize = 10;

// Get the requested page number
String pageStr = request.getParameter("page");
if (pageStr != null) {
pageNumber = Integer.parseInt(pageStr);
// String pageStr = request.getParameter("page");
// if (pageStr != null) {
// pageNumber = Integer.parseInt(pageStr);
// }

if (request.getParameter("page") != null) {
try {
pageNumber = Integer.parseInt(request.getParameter("page"));
} catch (Exception e) {
response.sendRedirect("./error-404");
return;
}
}

List<Customer> customers = Singleton.customerDAO.pagination((pageNumber - 1) * pageSize, pageSize);
Expand All @@ -38,7 +47,6 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
request.setAttribute("totalPages", totalPages);
request.setAttribute("pageSize", pageSize);
request.setAttribute("page", "customer");


request.getRequestDispatcher("/view/jsp/management/customer/customer.jsp").forward(request, response);
}
Expand Down

0 comments on commit e000fc5

Please sign in to comment.