解决displaytag1.1大数据量分页显示的索引存在bug

org.displaytag.pagination.SmartListHelper.java
把下面两个方法的代码改写如下:

     public int getFirstIndexForCurrentPage() {
        return (this.currentPage - 1) * this.pageSize;
    }

    /**
     * Returns the index into the master list of the last object that should appear on the current page that the user is
     * viewing.
     * @return int
     */
    protected int getLastIndexForCurrentPage() {
        if (this.partialList) {
            return (getFirstIndexForCurrentPage()) +
                    Math.min(this.pageSize - 1, this.fullList.size() - 1);
        } else {
            return getLastIndexForPage(this.currentPage);
        }
    }

 

你可能感兴趣的:(displaytag)