2013-03-04 57 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

回答