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 is instanceof operator used in java?
is it possible to instantiate the math class?
What is an empty list in java?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
What are the advantages of java?
What is the reflection?
What is a super method?
Why is it important to initialize a variable?
What are assembly attributes?
How can we make a class singleton?
What are selection structures?
How do listeners work?
Is linked list a linear or non-linear data structure?
Which java ide is used the most?
What are the two ways to create a thread?