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


Please Help Members By Posting Answers For Below Questions

Is multiple inheritance supported by java?

506


Explain java thread life cycle.

579


What is boolean law?

514


What is size () in java?

544


What are the different types of constructor?

523






Which is easier .net or java?

641


What are the differences between wait() and sleep()?

537


What are the 6 boolean operators?

549


What are different types of multitasking?

543


What is return used for in java?

515


What do you mean by garbage collection used in java?

569


What does %d do in java?

578


Does A Class Inherit The Constructors Of Its Superclass?

536


what is meant by encapsulation?

623


What is the difference between scrollbar and scrollpane?

607