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 off heap memory?
Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.
How can I debug the Java security exceptions and AccessControlExceptions?
What is garbage collection? What is the process that is responsible for doing that in java?
What is jagged array in java?
Can we have static methods in an interface?
What is the difference between heap memory and stack memory?
What is treemap in java?
What is binary search in java?
which swing component is similar to rich text box in .net/vb
what is the difference between sleep() and Wait()?
what is interface in java? Explain