</pre><pre name="code" class="html"><div class="pagination">
<span>第 <s:property value="pageBean.page"/>/<s:property value="pageBean.totalPage"/> 页</span>
<s:if test="cid != null">
<s:if test="pageBean.page != 1">
<a href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value="cid"/>&page=1" class="firstPage"> </a>
<a href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value="cid"/>&page=<s:property value="pageBean.page-1"/>" class="previousPage"> </a>
</s:if>
<s:iterator var="i" begin="1" end="pageBean.totalPage">
<s:if test="pageBean.page != #i">
<a href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value="cid"/>&page=<s:property value="#i"/>"><s:property value="#i"/></a>
</s:if>
<s:else>
<span class="currentPage"><s:property value="#i"/></span>
</s:else>
</s:iterator>
<s:if test="pageBean.page != pageBean.totalPage">
<a class="nextPage" href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value="cid"/>&page=<s:property value="pageBean.page+1"/>"> </a>
<a class="lastPage" href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value="cid"/>&page=<s:property value="pageBean.totalPage"/>"> </a>
</s:if>
</s:if>
<s:if test="csid != null">
<s:if test="pageBean.page != 1">
<a href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="csid"/>&page=1" class="firstPage"> </a>
<a href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="csid"/>&page=<s:property value="pageBean.page-1"/>" class="previousPage"> </a>
</s:if>
<s:iterator var="i" begin="1" end="pageBean.totalPage">
<s:if test="pageBean.page != #i">
<a href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="csid"/>&page=<s:property value="#i"/>"><s:property value="#i"/></a>
</s:if>
<s:else>
<span class="currentPage"><s:property value="#i"/></span>
</s:else>
</s:iterator>
<s:if test="pageBean.page != pageBean.totalPage">
<a class="nextPage" href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="csid"/>&page=<s:property value="pageBean.page+1"/>"> </a>
<a class="lastPage" href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="csid"/>&page=<s:property value="pageBean.totalPage"/>"> </a>
</s:if>
</s:if>
</div>
<s:iterator var="i" begin="1" end="pageBean.totalPage">
这一句相当于Java里面的for循环for(var=i;i<=pageBean.totalPage;i++){}