我正在将数据从数据库提取到 DAOImpl 中的列表中,然后使用模型对象将此列表传递给 JSP。
当数据行数低至 10-12 行时,页面加载正确,如果我增加行数,则页面无法正确加载
下面是我的代码,对于数据库中的行数较少的情况,它可以正常工作,
<c:choose>
<c:when test="${not empty frList }">
<c:forEach var="fLi" items="${frList }">
<div class='f-detail'>
<div class='f-image'><img src='gui/images/D.jpg'></div>
<div class='opt'>
<c:if test="${fLi.isan}">
<img src='guisdef/images/f441.png' title='This xx xxx'/>
</c:if>
<img src='gui/images/menu.png' class='context-menu' userData='<c:choose><c:when test="${fLi.assd}">${fLi.uhrt},YES,YES,${fLi.FName},${fLi.LName}</c:when><c:otherwise>${fLi.udd},NO,YES,${fLi.FName},${fLi.LName}</c:otherwise></c:choose>'/>
</div>
<div class='nameTag'>
<span class='f-name'> <a href="#/profile">${fLi.FName} ${fLi.LName}</a></span><br />
<span class='tagLine'>${fLi.tag}</span>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
JSP获取数据大小是否有限制
请提出建议。
问候, 莫妮卡
最佳答案
您应该知道的第一件事是不需要使用<c:when test="${not empty frList }">
。我还认为 <c:choose>
是没用的。所以你的代码应该改为:
<c:forEach var="fLi" items="${frList }">
<div class='f-detail'>
<div class='f-image'><img src='gui/images/D.jpg'></div>
<div class='opt'>
<c:if test="${fLi.isan}">
<img src='guisdef/images/f441.png' title='This xx xxx'/>
</c:if>
<img src='gui/images/menu.png' class='context-menu' userData='<c:choose><c:when test="${fLi.assd}">${fLi.uhrt},YES,YES,${fLi.FName},${fLi.LName}</c:when><c:otherwise>${fLi.udd},NO,YES,${fLi.FName},${fLi.LName}</c:otherwise></c:choose>'/>
</div>
<div class='nameTag'>
<span class='f-name'> <a href="#/profile">${fLi.FName} ${fLi.LName}</a></span><br />
<span class='tagLine'>${fLi.tag}</span>
</div>
</div>
</c:forEach>
关于java - 完整的 Jsp 页面未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29565066/