快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

澳门威泥斯人_博格自动化网进入



Displaytag1.1支持在外部实现大年夜数据量分页。主要有两种要领实现:

Displaytag 1.1 offers two alternative ways for working with partial澳门威泥斯人 lists:

the first one uses the valuelist pattern, and requires that the object that you give to displaytag implements the org.displaytag.pagination.PaginatedList interface. You can pass this object to displaytag as an usual list, and it will extract paging and sorting information from it. This way is more recommended if you have to build your backend layer and you can easily follow this pattern.

a second way, recommended if you only have to use partial list for few tables that show a performance problem using full lists, is passing all the needed parameters as separate tag attributes (recors to be shown, page number, total number of records...)

此中第二种要领看起来较为简单,只需在中增添两个属性:partialList="true"s澳门威泥斯人ize="resultSize"即可,然则在应用发明这种要领因为澳门威泥斯人是在原本内存分页的根基上改动的,以是照样存在一些Bug(比如:分页导航的值不会变......)

以是这里先容Displaytag保举的第一种要领,即:

实现org.displaytag.pagination.PaginatedListorg.displaytag.pagination.PaginatedList接口。

实现PaginatedList接口:

importjava.util.List;

importorg.displaytag.pagination.PaginatedList澳门威泥斯人;

importorg.displaytag.properties.SortOrderEnum;

/** */ /**

* 分页列表

*

*@authorJohn.Zhu

*

*/

publicclassPageListimplementsPaginatedList {

/** */ /**

* 每页的列表

*/

privateList list;

/** */ /**

* 当前页码

*/

privateintpageNumber=1 ;

/** */ /**

* 每页记录数 page size

*/

privateintobjectsPerPage=15 ;

/** */ /**

* 总记录数

*/

privateintfullListSize=0 ;

privateString sortCriterion;

privateSortOrderEnum sortDirection;

privateString searchId;

publicList getList(澳门威泥斯人) {

returnlist;

}

publicvoidsetList(List list) {

this .list=list;

}

publicintgetPageNumber() {

returnpageNumber;

}

publicvoidsetPageNumber( intpageNumber) {

this .pageNumber=pageNumber;

}

publicintgetObjectsPerPage() {

returnobjectsPerPage;

}

publicvoidsetObjectsPerPage( intobjectsPerPage) {

this .objectsPerPage=objectsPerPage;

}

publicintgetFullListSize() {

returnfullListSize;

}

publicvoidsetFullListSize( intfullListSize) {

this .fullListSize=fullListSize;

}

publicString getSortCriterion() {

returnsortCriterion;

}

publicvoidsetSortCriterion(String sortCriterion) {

this .sortCriterion=sortCriterion;

}

publicSortOrderEnum getSortDirection() {

returnsortDirection;

}

publicvoidsetSortDirection(SortOrderEnum sortDirection) {

this .sortDirection=sortDirection;

}

publicString getSearchId() {

returnsearchId;

}

publicvoidsetSearchId(String searchId) {

this .searchId=searchId;

}

}

您可能还会对下面的文章感兴趣: