在jsp页面中显示7000条记录

时间:2013-03-04 18:31:37

标签: ajax jsp jquery struts struts1

在基于Struts的应用程序上工作时,我需要从数据库中加载并显示7000条记录,jsp页面需要花费更多时间来渲染7000条记录,并且在加载数据时浏览器会受到攻击。这是我的代码...我不知道如何在滚动reahes bottom时显示数据而我从未使用过AJAX。请帮我。

<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>

1 个答案:

答案 0 :(得分:0)

对于您正在寻找的内容,存在类似的问题。 您可以在此处找到它:jQuery load more data on scroll