struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: [OT] Help !! Too many select-box in one page
Date Tue, 10 May 2005 09:16:17 GMT
the problem as I have said in both my previous replies is that you cannot possibly expect 17,000
lines of HTML to be fast not matter how you go about generating that 17,000 lines of code.

so, as I have suggested, you need to look at your forms design and break it down into more
pages I would say

Form now:

select1
select2
select3
select4

Re-factor 2-step process

Page 1

select1
select2

Page 2

select3
select4

FOR EXAMPLE. Please note I am not in a position to tell you how to design your forms or application,
but I am in a position to tell you that there is nothing you can do about making 17,000 lines
of HTML quicker (unless you buy a new desktop PC for every user and increase network bandwidth
;) ). 

Re-factor Re-factor Re-factor


> -----Original Message-----
> From: Cliff Lam [mailto:cliff@reinfo.com.hk]
> Sent: 10 May 2005 10:07
> To: Struts Users Mailing List
> Subject: Re: [OT] Help !! Too many select-box in one page
> 
> 
> Thank you very much for your reply ^^
> 
> You are right !! I should not get the list from db so many times ^^"
> 
> But I want to solve the loading time in the client side frist = (.
> 
> It loaded 1 min even I copy the html source code loaded in 
> the drameweaver =
> (
> 
> it is the html has 17XXX lines is too big ?
> 
> Thanks a lot !!!!
> 
> Cliff
> 
> ----- Original Message ----- 
> From: "Allistair Crossley" <Allistair.Crossley@QAS.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Tuesday, May 10, 2005 4:58 PM
> Subject: RE: [OT] Help !! Too many select-box in one page
> 
> 
> > yes you won't be able to solve that problem if you are 
> rendering 88 select
> boxes. why? because you are rending 88 select boxes that are 
> populated from
> the database. no amount of client-sise javascript (yuck) is 
> going to help
> you.
> >
> > you need to re-factor your design which is clearly not 
> working for you.
> >
> > if you absolutely cannot re-factor the design, then you 
> could consider
> using some caching strategy to prevent the huge database 
> lookup more than
> once using something like OSCACHE perhaps.
> >
> > you could also consider hitting the database for 1 select list and
> building the html select
> > list into a java String, i.e
> >
> > String select = "<select name=\"PLACEHOLDER\">";
> > // loop database result set adding <option> to select
> > // render JSP page
> >
> > in your JSP, replace the PLACEHOLDER with the select name you need
> >
> > <%
> >   String select = request.getAttribute("select");
> > %>
> >
> > <%= select.replaceAll("PLACEHOLDER", "selectNameA") %>
> > <%= select.replaceAll("PLACEHOLDER", "selectNameB") %>
> >
> > This method therefore hits the database ONCE (since you say 
> you can reuse
> the select lists) and should be much faster.
> >
> > Allistair.
> >
> > > -----Original Message-----
> > > From: Cliff Lam [mailto:cliff@reinfo.com.hk]
> > > Sent: 10 May 2005 09:52
> > > To: Struts Users Mailing List
> > > Subject: Re: [OT] Help !! Too many select-box in one page
> > >
> > >
> > > Thank you for your reply
> > >
> > > I get the options from the db
> > >
> > > But the main concern is in the client side .......
> > >
> > > It loaded about 1min for the 17XXX lines html .......
> > >
> > > Cliff
> > >
> > > ----- Original Message ----- 
> > > From: "rmanchu" <rmanchu@gmail.com>
> > > To: "Struts Users Mailing List" <user@struts.apache.org>
> > > Sent: Tuesday, May 10, 2005 5:27 PM
> > > Subject: Re: [OT] Help !! Too many select-box in one page
> > >
> > >
> > > >
> > > > how r u rendering you select boxes? ie, database call for
> > > each render?
> > > >
> > > > riyaz
> > > >
> > > > Cliff Lam wrote:
> > > > > Hi,
> > > > >
> > > > > My page has too many select-box in one page. The .html
> > > has 17XXX lines.
> > > > >
> > > > > This make the page load for a long time to appear =(
> > > > >
> > > > > Anyone face this problem too??
> > > > >
> > > > > Please give me some idea > <" Thx a lot
> > > > >
> > > > > Cliff
> > > >
> > > >
> > > >
> > > 
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > <FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE>
> > -------------------------------------------------------
> > QAS Ltd.
> > Developers of QuickAddress Software
> > <a href="http://www.qas.com">www.qas.com</a>
> > Registered in England: No 2582055
> > Registered in Australia: No 082 851 474
> > -------------------------------------------------------
> > </FONT>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message