This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Display Table on Page with Limited Number of Rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display Table on Page with Limited Number of Rows " Watch "Display Table on Page with Limited Number of Rows " New topic
Author

Display Table on Page with Limited Number of Rows

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1436
I think I have inquired about this some time back but never got very far.

I would like some direction on the best way to display large number of records in a table. The data is gathered remotely, placed into an array, then jstl builds the table for display. The array is built in seconds but the table takes a while to build and display. I figure the correct thing to do is limit the number of rows the jstl has to loop through.

Is this correct? If so what is the best approach?
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


Hello Steve,

I am able to think of a few available options. Well here they are :-

1. Fetch the rows in batches and sent those batches of rows to the client.
2. Fetch as above (in batches) but send all of them (to the client) in one go (could take time in the display) and display them on the page in a paginated manner.
3. Fetch as above (in batches) but send a few batches in an optimistic manner and raise a new request if a different batch/page is being requested for.
4. Use a taglib e.g. display-tag which does the necessary processing and help with the pagination too in a configurable manner.

Cheers,
Raj.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

You should never fetch more data than you plan to display. The JSP FAQ puts forth some strategies.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Display Table on Page with Limited Number of Rows