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



I have 100 records in a table with two rows. I need to display 10 records per page like Google Sea..

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

I have 100 records in a table with two rows. I need to display 10 records per page like Google Sea..

Answer / sivadasan

Thanks Avani...

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Core Java Interview Questions

Difference between java and javascript

0 Answers  


Why do we need hashmap in java?

0 Answers  


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

0 Answers  


How do you check if a string is lexicographically in java?

0 Answers  


What is the nested interface?

0 Answers  


What is the use of protected in java?

0 Answers  


What is user defined exception?

4 Answers  


What is the different between get and post?

0 Answers  


What is the use of parseint in java?

0 Answers  


What are the three parts of a lambda expression? What is the type of lambda expression?

0 Answers  


How can we make a class singleton?

0 Answers  


What is an example of declaration?

0 Answers  


Categories