PaginationSupport分页

java action:
PaginationSupport pagination = this.getBill2Service().getBillPayList(detachedCriteria, form.getStartIndex());
List list = pagination.getItems();
request.setAttribute("billList", list);
request.setAttribute("pagination", pagination);

java form:
private int startIndex;
public int getStartIndex() {
return startIndex;
}
public void setStartIndex(int startIndex) {
this.startIndex = startIndex;
}

html:
<html:form action="#" method="post">
<html:hidden property="startIndex" />
<jsp:useBean id="pagination" scope="request" class="com.worthtech.billportal.util.PaginationSupport"/>
<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#4DB0E7" class="TableMain">
  <tr bgcolor="#FFFFFF">
    <td width="17%">总记录 <%=pagination.getTotalCount()%> 条;总<%=pagination.getPages()%>页,当前<%=pagination.getCurrentPage()%>页
    <input title="首页" class="menuList" name="1" type="submit" onClick="this.document.forms[0].startIndex.value='0';this.document.forms[0].submit();" value="首  页">
    <input title="上一页" class="menuList" name="1" type="submit" onClick="this.document.forms[0].startIndex.value=<%=pagination.getPreviousIndex()%>;" value="上一页">
    <input title="下一页" class="menuList" name="1" type="submit" onClick="this.document.forms[0].startIndex.value=<%=pagination.getNextIndex()%>;" value="下一页">
    <input title="尾页" class="menuList" name="1" type="submit" onClick="this.document.forms[0].startIndex.value=<%=pagination.getLastIndex()%>;" value="尾页">
    </td>
  </tr>
</table>
</form>

你可能感兴趣的:(java,html)