分享jstl实现分页,类似百度分页
<c:if test=" ${requestScope.curPage <= 0}">
</ c:if>
< c:if test=" ${requestScope.curPage != 1 && requestScope.curPage > 0}">
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=${curPage-1} ">上一页 </a></li>
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=1"> 1</a></li>
< c:if test=" ${curPage-1 != 1}">
<li><span>...</span></li>
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=${curPage-1} ">${curPage-1} </a></li>
</ c:if>
</ c:if>
< c:if test=" ${requestScope.curPage > 0}">
<li><a href="javascript:;" style=" color: #6CF ;" class="active" >${curPage}</a></li>
</ c:if>
< c:if test ="${curPage != maxPage}">
< c:if test=" ${curPage+1 != maxPage}">
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=${curPage+1} ">${curPage+1} </a></li>
<li><span>...</span></li>
</ c:if>
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=${maxPage} ">${maxPage} </a></li>
<li><a href=" <%=basePath%>searchCompanyList.do?curPage=${curPage+1} ">下一页 </a></li>
</ c:if>