<c:choose>
<c:when test="${pageBean.currentPage == 1}">
首页 上一页
</c:when>
<c:otherwise>
<a href="/xiaoneinew/article.do?flag=showArticleUI&page=1">首页</a>
<a href="/xiaoneinew/article.do?flag=showArticleUI&page=${pageBean.currentPage - 1 }">上一页</a>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${pageBean.currentPage != pageBean.totalPage}">
<a href="/xiaoneinew/article.do?flag=showArticleUI&page=${pageBean.currentPage + 1 }">下一页</a>
<a href="/xiaoneinew/article.do?flag=showArticleUI&page=${pageBean.totalPage }">末页</a>
</c:when>
<c:otherwise>
下一页 末页
</c:otherwise>
</c:choose>
</td>
</tr>
点击下一页、上一页没有效果。
action代码:
public ActionForward showArticleUI(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
//得到当前用户[从session取出]
Users loginUser = (Users) request.getSession().getAttribute("loginuser");
this.pageBean = articleService.queryForPage(loginUser.getId(), 8, page);
this.listArticle = this.pageBean.getList();
request.setAttribute("pageBean", pageBean);
request.setAttribute("listArticle", listArticle);
//System.out.println(pageBean);
return mapping.findForward("goShowArticleUI");
}
page=${pageBean.currentPage - 1 }">上一页
你的当前页是用page表示么?
currentPage = ¥{pageBean.currentPage-1}