| Author |
Problem With Pagination
|
A.S. HariLal
Greenhorn
Joined: Oct 24, 2007
Posts: 28
|
|
Hai Dear Friends, I did my pagination with the help of pager tag lib. It's working well. But I noticed that it fetch all the data's from table for each iteration.( Iteration means when I select Next or Previous link)But it display the data's based on the offset. I hope It's not good method. If I have a database containing 1000 items and for each iteration , If it takes all the data's .....the syutem will go wrong.....so I hope there will be an alternative method or a solution to solve it.....so if any one experience such like problems and solve it.....kindly help me...... Regards,ashl
|
 |
Brent Sterling
Ranch Hand
Joined: Feb 08, 2006
Posts: 948
|
|
There are more advanced things you can do with the pager tablib, but with a basic implementation your action will load all the records from the database and the taglib will "throw away" all the records except the ones needed for the current page. This seems very wasteful, but I have found this to be acceptable in most cases. One simple optimization is to store the results on the session so you don't have to query the database each time. This solution does not work well for very large datasets or sites with lots of users. - Brent
|
 |
xu yuanzhi
Greenhorn
Joined: Nov 20, 2007
Posts: 6
|
|
|
You will calculate which records to be displayed in page with page number,order(desc or asc) and how many records is displayed in one page. As said above, it may be wastful
|
 |
A.S. HariLal
Greenhorn
Joined: Oct 24, 2007
Posts: 28
|
|
Thank you For the answers........ -ashl
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
"ASHL", Please check your private messages before posting to the ranch again.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Problem With Pagination
|
|
|