在下面代码中显示返回的“allStaList”,其中有600多条数据,显示时间需等待16秒左右,有什么好的处理方法吗?
<logic:notEmpty name="staDisplayForm" property="allStaList">
<logic:iterate id="sta" indexId="index" name="staDisplayForm" property="allStaList">
<%
String co = "";//行间颜色
if ((index%2) == 0) co = "#D0E4EF";
else co = "#FFFFFF";
%>
<tr bgcolor=<%=co %> align="center">
<td><bean:write name="sta" property="stName"/></td>
<td><bean:write name="sta" property="strStaType"/></td>
<td><bean:write name="sta" property="district"/></td>
<td><bean:write name="sta" property="jd"/></td>
<td><bean:write name="sta" property="wd"/></td>
<td><c:choose>
<c:when test="${sta.isShow == 1}">
<input type="checkbox" onclick="UpdateSetup(this)" value="1_<bean:write name='sta' property='stId'/>" checked="checked"/>
</c:when>
<c:otherwise><input type="checkbox" onclick="UpdateSetup(this)" value="1_<bean:write name='sta' property='stId'/>" /></c:otherwise>
</c:choose></td>
<td><c:choose>
<c:when test="${sta.isShowRep == 1}">
<input type="checkbox" onclick="UpdateSetup(this)" value="2_<bean:write name='sta' property='stId'/>" checked="checked"/>
</c:when>
<c:otherwise><input type="checkbox" onclick="UpdateSetup(this)" value="2_<bean:write name='sta' property='stId'/>"/></c:otherwise>
</c:choose></td>
</tr>
</logic:iterate>
</logic:notEmpty>
<logic:notEmpty name="staDisplayForm" property="allStaList">
<logic:iterate id="sta" indexId="index" name="staDisplayForm" property="allStaList">
<%
String co = "";//行间颜色
if ((index%2) == 0) co = "#D0E4EF";
else co = "#FFFFFF";
%>
<tr bgcolor=<%=co %> align="center">
<td><bean:write name="sta" property="stName"/></td>
<td><bean:write name="sta" property="strStaType"/></td>
<td><bean:write name="sta" property="district"/></td>
<td><bean:write name="sta" property="jd"/></td>
<td><bean:write name="sta" property="wd"/></td>
<td><c:choose>
<c:when test="${sta.isShow == 1}">
<input type="checkbox" onclick="UpdateSetup(this)" value="1_<bean:write name='sta' property='stId'/>" checked="checked"/>
</c:when>
<c:otherwise><input type="checkbox" onclick="UpdateSetup(this)" value="1_<bean:write name='sta' property='stId'/>" /></c:otherwise>
</c:choose></td>
<td><c:choose>
<c:when test="${sta.isShowRep == 1}">
<input type="checkbox" onclick="UpdateSetup(this)" value="2_<bean:write name='sta' property='stId'/>" checked="checked"/>
</c:when>
<c:otherwise><input type="checkbox" onclick="UpdateSetup(this)" value="2_<bean:write name='sta' property='stId'/>"/></c:otherwise>
</c:choose></td>
</tr>
</logic:iterate>
</logic:notEmpty>
解决方案 »
- 求解
- 怎么将ResultSet中所有的值全都遍历到List中
- 100求解......tomcate 为什么每天都要“死掉”
- 一个小问题..
- 本人因为最近急需钱用,想出售自己部分flex+java作品(工作流系统,博客系统)
- cobol的趋势
- Struts2配置了开发者模式 但是实际struts.xml却不会自动重载 每次还是需要重启tomcat服务器 请高手解答
- 请问如何将网页上的值传到class文件中。
- 请问做JSP开发时选用了JSP的WEB服务器,还需要IIS干什么?
- 求助:Dreamweaver的层的相对定位,请看里面的具体描述....非常着急..谢谢...
- 谁能提供点好的spring和hibernate的书吗
- 一个烦人关于 Servlet.service() for servlet jsp threw exception的问题!!!急呀!!!!
难道页面显示中没有分页?
也许看个十几条就关掉,如果是这样的话还有 500 多条加载进来完全是无用功。
所以就应该采用分页。大数量的分页应采用 SQL 分页形式,也就是说第 1 页时只选第 1~20 条记录,
当点下一页或第 2 页时,再重新查询数据库,这时使用 SQL 选取第 21~40 条
记录。
2,在js里利用ajax
3, 利用分页,客户端请求的时候可以不一次显示全部数据
比如一次请求传2页数据,1页数据hidden
一页5000条的分页都做过,也没你那样的