用到分页标签
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %> <pg:pager scope="request" maxIndexPages="5" index="center" maxPageItems="<%=pageSize%>" url="<%= request.getRequestURI() %>" items="<%=dataTotal%>" export="currentPageNumber=pageNumber">  
 <pg:first><a href="${pageUrl}&sampleBaseId=<%=sampleBaseId %>&sId=<%=sId%>&tirId=<%=tirId%>" onclick="Go(1);" class="contentLabel">首页</a></pg:first>  
        <pg:prev><a href="${pageUrl}&sampleBaseId=<%=sampleBaseId %>&sId=<%=sId%>&tirId=<%=tirId%>" onclick="Go(1);" class="contentLabel">前页</a></pg:prev>  
  <pg:page>  
  </pg:page>  
        <pg:pages>  
            <c:choose>  
            <c:when test="${pageNumber eq currentPageNumber }">  
            <font color="red" class="contentLabel">${pageNumber }</font>  
            </c:when>  
            <c:otherwise>  
            <a href="${pageUrl}&sampleBaseId=<%=sampleBaseId %>&sId=<%=sId%>&tirId=<%=tirId%>" onclick="Go(1);" class="contentLabel">${pageNumber}</a>  
            </c:otherwise>  
            </c:choose>  
   </pg:pages>  
        <pg:next><a href="${pageUrl}&sampleBaseId=<%=sampleBaseId %>&sId=<%=sId%>&tirId=<%=tirId%>" onclick="Go(1);" class="contentLabel">下页</a></pg:next>  
        <pg:last><a href="${pageUrl}&sampleBaseId=<%=sampleBaseId %>&sId=<%=sId%>&tirId=<%=tirId%>" onclick="Go(1);" class="contentLabel">尾页</a></pg:last>  
</pg:pager> 想先执行 onclick中的处理,后跳页面,原理上是这样,但是执行结果不一定,有时候执行了onclick,有的时候没有执行。不知道什么原因