File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes view huge amount of records in JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "view huge amount of records in JSP page" Watch "view huge amount of records in JSP page" New topic
Author

view huge amount of records in JSP page

Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
Hi,
i'm looking for an elegant way to present lot of records in jsp page (number of records more than 200 000)
there is an idea how to presente this data ? using pagination ? it will be slow ?
or you have another idea ?

thakns and regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Well, you would never load more than 100 records or so, because the user couldn't possibly digest more than that. So it needn't be slow if you get the pagination logic right. And no user is ever going to click through 200000 records, no matter how well you do it. Are you sure you need to do this? (And by "need" I don't mean "you have been told to do it", but "it is the right thing to do for the user".)


Ping & DNS - my free Android networking tools app
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
This is the problem, user need to view this data, i'm looking for the right way or the elegant way to show this data, have you any proposition ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Can you be more precise? No user is ever going to be looking at 200000 records. Maybe you need more options for searching and selecting data so that it comes down to a manageable size?
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
I understand what you mean, but in some case after aplying searching and selecting options we got many records , i think that i should show just few records, isn't good to show lot of records ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
In that case, just show a mesage that there are too many records, and that the user needs to narrow down the search criteria. Trust me, no user wants to be presented with 200000 records :-)
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
Thank you, then i should count first? if the number is too big, i should show to user that the number of records is too big ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Yes, do a "select count(*) ..." first.
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
Ok, i wil do it first. if the nulmber of records is around 2000? should i do a pagination solution ??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Well, you should know best what your users can handle and are willing to handle. I can just say that *I* would not be willing to go through 2000 records, or even 1000. Depends on what "going through" means, of course.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

I always allow users to filter large data sets to hone it down to just what they need to see. And I always page the results. That way, they can see that the result of their filtering yields too many records (e.g. "Showing page 1 of 2056") but since they are only presented with the first page, they are not overwhelmed (nor is the system), and they know that they need to filter down further.

So for me: filtering and paging.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
Ok thank you so much, and how many records should be shown to users (per page)?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Why not ask the users? They'll have to live with it, after all.
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
I think there is a standard number of records to be shown to users. but i prefere to ask users ;)
Thank you
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 1038
    
  13

Julio leopard banderas wrote:I think there is a standard number of records to be shown to users. but i prefere to ask users ;)
Thank you


For tasks like this I prefer to use the jQuery plugin called DataTables. It provides a nicely formatted way to display the data, provides the pagination you seek and allows the user to select how many records to view at a time, i.e. 10, 25, 50, etc.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42595
    
  65
Or, for a more Java-centric approach, the http://www.displaytag.org/1.2/ JSP tag library. That also has a bunch of nice features (like data export to various file formats).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Ulf Dittmer wrote:Why not ask the users? They'll have to live with it, after all.

Exactly. I let the users choose the "page size" (within reasonable limits).
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2431
    
  28

You could do dynamic scrolling like facebook does, but it would require more work. The way it does is the first 100 records are loaded on startup. At the bottom of the page, there is a "See more" link that does an Ajax call to get the next 100 records, and dynamically add it to the list. From the user POV, there is no pagination, although behind the scenes you still retreive 100 records at a time from the DB.

I don't know if there is a JQuery component that does this for you.
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
isn't a slow way ?? to use this way ? as we know users like more power application tht respond verry quick
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Avoid "design by rumor". What real evidence do you have that it would be slow? The real question is: would it be the most suitable way to present the data to the users? Worry about performance later.
Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
you are absolutly right, because with many records what will decrease the performance of the application, i think pagination is the best way ,
what do you think ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: view huge amount of records in JSP page