我们在编写前台页面的时候,经常会显示一些菜单栏。每个导航栏目下面显示有几条信息,为了让jsp代码看上去规范一些。我们通常情况下,会把导航栏下面循环显示的信息放到iframe框架中。因为这样可以使页面代码看上去更美观和规范化,如:
<td height="190" valign="top"> <iframe src="${pageContext.request.contextPath}/news/list/listSuccess.action?params=pingTaiGongGao&flag=1&pageSize=8" width="100%" scrolling="no" frameborder="0" marginwidth="120" marginheight="100" style="background-color:#ffffff" ></iframe> </td>
这个iframe的页面是;
<table width="300" border="0" cellspacing="0" cellpadding="0"> <c:if test="${not empty pingTaiGongGao}"> <c:forEach items="${pingTaiGongGao}" var="news" varStatus="num"> <tr> <td width="12" height="23" align="left"> <img src="${pageContext.request.contextPath}/images/webimages/dot01.jpg" width="6" height="7" /> </td> <td align="left"> <a href="${pageContext.request.contextPath}/news/newsDetail.action?id=${news.id}" target="_blank"><script language='javascript'>'${news.title}'.subString(0,18);</script>...</a> </td> </tr> <tr> <td colspan="2" background="${pageContext.request.contextPath}/images/webimages/dot02.jpg" height="1"></td> </tr> </c:forEach> </c:if> </table>