Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP  RSS feed

 
Carol David
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My jsp page is taking lots of time to load on...My Webserver is IIS and the records to be loaded at a time is more than 5000. How to make it to be loaded in less timing.
 
Edward Kenworthy
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page it: eg load just 100 records first add only load the rest as you need them. Lazy load them so you don't load the complete record each time if you don't need it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
5000 records is way too much information to be useful. In addition to paging, consider adding search and filter facilities so your users can query for just the data they need.
 
Dharmanand Singh
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Carol David:
My jsp page is taking lots of time to load on...My Webserver is IIS and the records to be loaded at a time is more than 5000. How to make it to be loaded in less timing.


Load few records at a time, say 100 records (which might be most useful for the user) and add 'Previous' and 'Next' links or buttons
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
let's see. 5000 records, each taking 100 bytes of html code at least (my guess, likely to be more if the data is more than trivial).
So even with that trivial amount of data over the line per record you are sending half a megabyte to the browser for every request to the page.

Even without the time needed to query the database, interpret the results, and create the html code that's going to take a while.
If your users are on 1MB DSL lines it'll be 4 seconds at least just to send the data to the browser.
The amount of data means the browser will also take a good while to render and display it, bringning your request time to maybe 10 seconds.

Now add the response time of the database (likely several seconds for a dataset that large unless it's really well indexed), the time to create the html (probably several milliseconds per record or another 10-20 seconds) and you're up to a minute or so.

As already suggested, reduce the scope of your query to only 100 records or so.
 
programmerindia2000
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all .
i'm new member .
i'm from vietnam .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!