本案主要功能是完成數據集的分頁顯示
/******************program begin**************************/
package test;
import java
public final class PaginationInfo
implements Serializable {
/**頁大小描述每頁有多少行*/
private int pageSize =
/**是否有上一頁*/
private boolean hasPrevious;
/**是否有下一頁*/
private boolean hasNext;
/**總行數 */
private int total;
/**總頁數 */
private int totalPage;
/**當前頁碼*/
private int currentPageNumber=
/**跳轉動作
private int jumpState;
public void setPageSize(int pageSize) {
this
}
public int getPageSize() {
return pageSize;
}
public void setHasPrevious(boolean hasPrevious) {
this
}
public boolean getHasPrevious() {
return hasPrevious;
}
public void setPreviousPageNumber(int previousPageNumber) {
this
}
public int getPreviousPageNumber() {
return previousPageNumber;
}
public void setHasNext(boolean hasNext) {
this
}
public boolean getHasNext() {
return hasNext;
}
public void setNextPageNumber(int nextPageNumber) {
this
}
public int getNextPageNumber() {
return nextPageNumber;
}
public void setTotal(int total) {
this
}
public int getTotal() {
return total;
}
public void setTotalPage(int totalPage) {
this
}
public int getTotalPage() {
return totalPage;
}
public void setCurrentPageNumber(int currentPageNumber) {
this
}
public int getCurrentPageNumber() {
return currentPageNumber;
}
public void setJumpState(int jumpState){
this
}
public int getJumpState(){
return jumpState;
}
}
public void setPageInfo(PaginationInfo paginationInfo) {
//跳轉頁
if (paginationInfo
paginationInfo
}
if (paginationInfo
paginationInfo
}
if (paginationInfo
paginationInfo
}
if (paginationInfo
paginationInfo
}
int totalPage = total / paginationInfo
if (total % paginationInfo
paginationInfo
}
else {
paginationInfo
}
if (paginationInfo
paginationInfo
paginationInfo
paginationInfo
}
else if (paginationInfo
paginationInfo
paginationInfo
paginationInfo
paginationInfo
}
else {
paginationInfo
paginationInfo
}
}
<logic:equal name=
<td align=
<td align=
</logic:equal>
<logic:greaterThan name=
<td align=
<td align=
</logic:greaterThan>
<logic:equal name=
<td align=
<td align=
</logic:equal>
<logic:equal name=
<td align=
<td align=
</logic:equal>
<html:hidden name=
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28225.html