2013-03-04 70 views
0

在基于Struts的应用程序上工作时,我需要从数据库中加载和显示7000条记录,jsp页面需要更多时间来处理7000条记录,并且浏览器在数据加载时受到攻击。这里是我的代码...我不知道如何显示数据时,滚动reahes底部,我从来没有在AJAX工作。请帮帮我。在jsp页面中显示7000条记录

<div id="scroll" style="height: 225px;position: relative;width: 100%; overflow:hidden; "> 
<table id="mytable" class="tablesorter" style="width: 983px;" > 
    <thead > 
    <tr style="height:14px;width: 100%;" > 
     <th style="width: 5%;"><bean:message key="test.grid.date"/></th> 
     <th style="width: 2%;" ><bean:message key="test.grid.type"/></th> 
    <th style="width: 4%;"><bean:message key="test.grid.checkFED"/></th> 
     </tr> 
    </thead> 

<tbody style="height: 190px;margin-left: -2px;position:absolute;width: 1000px;overflow-x:hidden;overflow-y: scroll;"> 
<logic:iterate id="MaintDTO" indexId="index" name="maintForm" property="ReportList"> 
<logic:equal name="MaintDTO" property="transError" value="trans" > 
<td style="width: 5%;"><bean:write name="MaintDTO" property="date" /></td> 
    <td style="width: 2%;"><bean:write name="MaintDTO" property="type" /></td> 
    <td style="width: 4%;"><bean:write name="MaintDTO" property="checkNo" /></td> 
</logic:equal>   
</logic:iterate></tbody> 
</table> 
</div> 
+0

有无数滚动的演示,具体是什么问题?很明显,一次加载和显示7k条记录将需要相当长的时间。 – 2013-03-04 19:52:25

+2

“需要加载7000条记录”和“需要能够查看7000条记录”之间存在巨大差异。 – Quaternion 2013-03-04 19:53:17

+0

谢谢。是的,它需要更多的时间来呈现7000页的记录,当滚动到达底部时,我需要加载数据,但不知道如何去做。 – Vijaya 2013-03-04 20:32:08

回答