Pagination and sorting using JSP and Servlets