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 |
Write a program to find the greatest of three numbers in java?
What is constructor chaining in java?
Differentiate storage classes on the basis of their scope?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
How to override equals() and hashCode() method in java?
Write code of any action class?
What is a file pointer?
What is a condition in programming?
What is final keyword?
which one is performance wise advantageious from List,Set,Map?
What is the format of Inner Class after it compiled?
How to add two numbers with out using Arithmetic , union operators in java....? But we can use bitwise operators... but how...?