在c:foreach外面加
<tr>
<td colspan="100" align="center">
当前是第${info.pageNum}/${info.pages}页,共${info.total}条数据
<a href="list?page=1">首页</a>
<c:if test="${info.prePage>=1}"><a href="list?page=${info.prePage }">上一页</a></c:if>
<c:if test="${info.nextPage<=info.pages&&info.nextPage!=0 }"><a href="list?page=${info.nextPage }">下一页</a></c:if>
<a href="list?page=${info.pages}">尾页</a>
</td>
</tr>
即可实现并且用c:if判断时,在第一页不会出现上一页的按钮,避免了进入第0页的bug,
并且在最后一页时,不会出现下一页的东西 ,也不会进入第0页,避免了bug