调用此方法:
int pageNo=ps.getFenyePageNo(param,lastPage);
具体方法:
private int currentPageNo=1;
public int getFenyePageNo(String param, int lastPage) {
if ("first".equals(param) || null == param) {
currentPageNo = 1;
}
else if ("next".equals(param)) {
if (currentPageNo < lastPage) {
System.out.println("当前页3::"+currentPageNo);
currentPageNo++;
}
}
else if ("previous".equals(param)) {
if (currentPageNo > 1) {
currentPageNo--;
}
}
else if ("last".equals(param)) {
currentPageNo = lastPage;
}
return currentPageNo;
}
现在的问题就是::调用一次方法,数据就保存在currentPageNo里面了,需要不停的调用这个方法。
有没有什么办法,能每次调用完这个方法之后,就能清除这个方法里面的数据!!!
清除数据是我想要的结果,,哪位大神有什么好办法吗?????
The definition is wrong, the front end only passes
第几页
,每页size
就行了,然后后端算出limit,offset
, finds the data, and returns it to the front end.The request and return are as follows:
Defined as local variable return
For issues like pagination, it is best to have a common base class in the project. The public classes standardize the common features of paging. Because all list page queries need to use paging. The recommended code is as follows:
The page has a hidden field, which is used to store the current page No. When jumping to the page, currentPage No is submitted to the server and assigned a value.
It doesn’t matter whether the currentPageNo on the server is local or not, it is reassigned every time. If no value is submitted, it will be assigned a value of 1
Your actions all inherit a baseAction. This baseAction implements the Ipage interface, which implements the page, including the total number of pages, the page number, and the size of each page. . .
Local variables are done