日期:2014-05-17 浏览次数:20765 次
public ActionForward find(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Integer pageNo = 1;
Integer pageCount1 = ed.findParent().size()%5==0?ed.findParent().size()/5:(ed.findParent().size()/5+1);
Integer pageCount2 = ed.findChild().size()%5==0?ed.findChild().size()/5:(ed.findChild().size()/5+1);
Integer pageCount3 = id.findParent().size()%5==0?id.findParent().size()/5:(id.findParent().size()/5+1);
Integer pageCount4 = id.findChild().size()%5==0?id.findChild().size()/5:(id.findChild().size()/5+1);
request.setAttribute("defaulttab1", "default-tab");
request.setAttribute("pageNo1", pageNo);
request.setAttribute("pageNo2", pageNo);
request.setAttribute("pageNo3", pageNo);
request.setAttribute("pageNo4", pageNo);
request.setAttribute("pageCount1", pageCount1);
request.setAttribute("pageCount2", pageCount2);
request.setAttribute("pageCount3", pageCount3);
request.setAttribute("pageCount4", pageCount4);
request.setAttribute("expenseparents", ed.findParentByPage(pageNo));
request.setAttribute("expensechilds", ed.findChildByPage(pageNo));
request.setAttribute("incomeparents", id.findParentByPage(pageNo));
request.setAttribute("incomechilds", id.findChildByPage(pageNo));
return mapping.findForward("to_category");
}
public class PageBean {
private List list; // 要返回的某一页的记录列表
private int allRow; // 总记录数
private int totalPage; // 总页数
private int currentPage;// 当前页
private int pageSize; // 每页记录数
private boolean isFirstPage; // 是否为第一页
private boolean isLastPage; // 是否为最后一页
private boolean hasPreviousPage;// 是否有前一页
private boolean hasNextPage; // 是否有下一页
// getter和setter方法...