I have 100 records in a table with two rows. I need to
display 10 records per page like Google Search. I need only
the Logic(Pagination) in Pure Java. No JSP and all..Thanks
in Advance...
Answer Posted / avani
String strPageNum = request.getParameter(“pageNum”);
int pageNum = 0;
if(strPageNum != null){
pageNum = new Integer(strPageNum).intValue();
}
int maxRowsPerPage = new Integer(request.getParameter
(“rowsPerPage”)).intValue();
//calculate
int rowEnd = pageNum * maxRowsPerPage;
int rowStart = (rowEnd - maxRowsPerPage) + 1;
| Is This Answer Correct ? | 9 Yes | 8 No |
Post New Answer View All Answers
What does microservices mean?
What are default methods ?
What is the difference between serializable and externalizable interfaces?
What data type is string java?
How to create a base64 decoder in java8?
How do I know if java is installed?
How do you add an element to a hashset in java?
Define interface in java?
What is the indent key?
Explain method local inner classes ?
Can java list contain duplicates?
Why is string buffer better than string ?
What is final method?
Is array passed by reference in java?
What are anonymous inner classes?