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 |
Can static methods be overridden?
What is the Layout for ToolBar?
What is an immutable object? How do you create one in java?
Explain different ways of passing arguments to sub-routine?
What is constructor in java ?
How do you calculate square roots?
Why do we use return statement?
Can a final variable be initialized in constructor?
how to deploy apache tomcat server to weblogic server in java
Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in reverse order.
Explain the difference between collection api and stream api in java8?
What is the difference between a field variable and a local variable?