aspose file tools*
The moose likes Performance and the fly likes Optimize JSP Page loading time - very urgent......    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Optimize JSP Page loading time - very urgent......    " Watch "Optimize JSP Page loading time - very urgent......    " New topic
Author

Optimize JSP Page loading time - very urgent......

arun ramk
Greenhorn

Joined: Aug 09, 2008
Posts: 26
hi,
My jsp page is taking long time to load. I have several list boxes in the page and one of the listbox contains around 1 million records. Is there a better way to optimize my page so that it load fastly. It also taking more time even i load the listbox with 1million records in ajax using javascript separately.
Give me a better solution.
I am using JSP & STRUTS to display the page. I use <html ptions collection-""> tag to display the contents of the listboxes.


<html:select property="deviceNameId" multiple="true" size="4">
<option value="any" selected>Any</option>
<html ptions collection="DEVICE_LIST" property="deviceId" labelProperty="deviceName" />


</html:select>



Thanks in adavance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Very urgent response:

DON'T try to load all million records in a web page.

How in the world do you expect a user to use a list box to hunt through a million records

Think about how the user wants to find stuff and redesign your application.

How are the records organized? How do users locate the desired record?

Bill
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Originally posted by arun dangerous:
one of the listbox contains around 1 million records.


This is what is called a "Doctor Doctor" problem. The answer is "don't do that!"

As suggested upthread, more than 30 entries or so is a waste.
arun ramk
Greenhorn

Joined: Aug 09, 2008
Posts: 26
Hi ,
Thanks for your suggestions.
I have redesigned the list box in such a way that , initially i load it with 1000 items and when the user scrolls the list box to the end an event should be trigger and i will append the next 1000 items using ajax. Is there a way to find the scroll bar end event in html or dhtml or javascrpt and a way to load the items in the list box when the scroll bar the dragged to the end.
Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
"arun dangerous"-

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, you're still missing the point about the length of the menu. No user will want to scroll through 1000 entries, either. You need to find a way to structure the options in some way, probably hierarchically.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Ulf is exactly right, your current approach would only work well for the first few thousand items.

Step back from the current approach and think about how a typical user will want to look up data. Talking to real users is a good idea! Showing users mockups of proposed designs will help.

If you cant think of any other way than a list box then you need to provide an interface that can take big steps through the list, but surely there must be some organizing principle to this data. Dont think of adding items to the list box, clear and refill it after each jump.

If you want better suggestions, show us some typical data entries.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Optimize JSP Page loading time - very urgent......