aspose file tools*
The moose likes Struts and the fly likes Problem With Pagination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem With Pagination" Watch "Problem With Pagination" New topic
Author

Problem With Pagination

A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
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
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem With Pagination
 
Similar Threads
Pagination
Pagination
Pagination?
Pagination
PAGINATION