You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JoAnn Lemm <jl...@CAMELBACKRA.com> on 2004/10/26 00:45:14 UTC

Serious performance impact with iterator

Hey All,

I'm wondering if anyone else is seeing this impact.
I've got an iterator within an iterator thusly:


<table border='1' cellpadding='0' cellspacing='0'
style='BORDER-COLLAPSE: collapse' bordercolor='#111111'>
  <logic:iterate id="rowArray" name="batchForm"
property="rowBatchDetails" indexId="rowCount">
    <tr align="center"
bgcolor='<%=rowCount.intValue()%2==0?"#ffffff":"#dddddd"%>'>
       <logic:iterate id="colArray" name="rowArray" indexId="colCount">

              <logic:equal name="colCount" value="0">
                 <td  align='left' width='165' class='normaltxt'
height="20"> <!-- last name -->
                    <a
HREF="batch.do?action=Prospect&prospectChoice=<%=rowCount%>"
target="_top">
                         &nbsp;<bean:write name="colArray" /></a>
                  </td>
                 </logic:equal>

<etc ...>

        </logic:iterate>
      </tr>
   </logic:iterate>
</table>





The resulting html looks like the following. Note all the empty spaces.
Needless to say, this has impacted performance on the website
significantly by increasing the size of the page to something ludicrous
when I have more than 20 rows of data to display!
Anyone have a solution for this?  A patch somewhere?


<table border='1' cellpadding='0' cellspacing='0'
style='BORDER-COLLAPSE: collapse' bordercolor='#111111'>
 <tr align="center" bgcolor='#ffffff'>
                                

                                   
          <td  align='left' width='165' class='normaltxt' height="20">
<!-- last name -->
             <a HREF="batch.do?action=Prospect&prospectChoice=0"
target="_top">
                 &nbsp;Aiken</a>
          </td>

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   
                                 

                                   

                                   
       <td align='left' width='150' class='normaltxt' height="20"> <!--
first name-->
            <a HREF="batch.do?action=Prospect&prospectChoice=0"
target="_top">
                 &nbsp;Glenda</a>
       </td>

<and more of the same ...>

JoAnn Lemm

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


Re: Serious performance impact with iterator

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "JoAnn Lemm" <jl...@CAMELBACKRA.com>
> I'm wondering if anyone else is seeing this impact.
> The resulting html looks like the following. Note all the empty spaces.
> Needless to say, this has impacted performance on the website
> significantly by increasing the size of the page to something ludicrous
> when I have more than 20 rows of data to display!
> Anyone have a solution for this?  A patch somewhere?

Can you switch to using the JSTL tag <c:forEach> instead of logic:iterate?
I use that and don't have multiple blank lines showing up on each iteration.

You could also put a Filter on the webapp and remove extraneous spaces from
the outbound HTML response.

-- 
Wendy Smoak


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