如下图中的所示,我想做个类似的 希望各位给我一点点启发
[img]http://dl.iteye.com/upload/attachment/164999/f82fa7b7-f735-3269-90d4-4bea55fdd80d.jpg[/img]
如下图中的所示,我想做个类似的 希望各位给我一点点启发
[img]http://dl.iteye.com/upload/attachment/164999/f82fa7b7-f735-3269-90d4-4bea55fdd80d.jpg[/img]
显示的规律应该是显示第一页码,第二页码,当前页-1,当前页码,当前页+1,最后页-1,最后页码. 其它都以"..."表示.
静态实现:
[code="java"]
${e}/c:if
.../c:if
${e}/c:if
.../c:if
${e}/c:if
/c:forEach
[/code]
动态实现:
已对边界值做过处理,比如当前页为第一页或第二页或最后页或最后页的前一页.
要保证cur>=first && cur<=last即当前页码大于等于第一页码并且当前页码小于等于最后页码.
[code="java"]
<%
pageContext.setAttribute("first","1");
pageContext.setAttribute("last","26");
pageContext.setAttribute("cur","21");
%>
/c:if
/c:if
${e}/c:if
${e}/c:if
${e}/c:if
.../c:if
${e}/c:if
/c:forEach
[/code]