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...
Answers were Sorted based on User's Feedback
Answer / 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 |
What is compile time polymorphism?
20 Answers CTS, Elementus Technologies, Oracle,
What are the two ways you can synchronize a block of code?
What is the purpose of the system class in java?
What do you mean by thread safe?
What is inner class?what is the use of inner class?where we create the object for inner class? and inner class can extend any class or inner class can implement any interface?
What are extraneous variables examples?
What a static class can contains?
Can a class extend more than one class?
What is difference between call by value and call by reference?
Can we use this () and super () in a method?
What is math floor in java?
What is the return type of read()?