struts2+spring+hibernate分页代码[比较多]第4/7页

 更新时间:2008年09月27日 15:27:36   作者:  
J2EE系统中分页显示,修改dao层,service层,action层,两个分页类文件,代码如下

action类:
Java代码
复制代码 代码如下:

package com.last999.im.news.action;
import java.util.List;
import com.last999.im.news.web.PageTool;
import com.last999.im.news.web.PageMaker;
import com.last999.im.news.entity.KindEntity;
import com.last999.im.news.service.KindEntityManage;
public class KindViewAction extends SafeStruts2{
private List kindList;
private KindEntity kindEntity;
private KindEntityManage kindEntityManage;
private int ppp;
private PageMaker pageMaker;
private String pager;
public String getPager(){
return this.pager;
}
public void setPager(String pager) {
this.pager=pager;
}
public PageMaker getPageMaker(){
return this.pageMaker;
}
public void setPageMaker(PageMaker pageMaker) {
this.pageMaker=pageMaker;
}
public int getPpp(){
return this.ppp;
}
public void setPpp(int ppp) {
this.ppp=ppp;
}
public KindEntityManage getKindEntityManage(){
return this.kindEntityManage;
}
public void setKindEntityManage(KindEntityManage kindEntityManage) {
this.kindEntityManage=kindEntityManage;
}
public KindEntity getKindEntity(){
return this.kindEntity;
}
public void setKindEntity(KindEntity kindEntity) {
this.kindEntity=kindEntity;
}
public List getKindList(){
return this.kindList;
}
public void setKindList(List kindList) {
this.kindList=kindList;
}
public String kindView(){
PageTool pageInfo = new PageTool();
pageInfo.setCur(this.getPpp());
pageInfo.setTotal(this.getKindEntityManage().getRows());
setKindList(this.getKindEntityManage().getKindEntity(pageInfo));
PageMaker pageMaker = new PageMaker();
setPager(pageMaker.makeList(pageInfo,"kindView.action?ppp="));
return SUCCESS;
}
}

复制代码 代码如下:

package com.last999.im.news.action;
import java.util.List;
import com.last999.im.news.web.PageTool;
import com.last999.im.news.web.PageMaker;
import com.last999.im.news.entity.KindEntity;
import com.last999.im.news.service.KindEntityManage;
public class KindViewAction extends SafeStruts2{
private List kindList;
private KindEntity kindEntity;
private KindEntityManage kindEntityManage;
private int ppp;
private PageMaker pageMaker;
private String pager;
public String getPager(){
return this.pager;
}
public void setPager(String pager) {
this.pager=pager;
}
public PageMaker getPageMaker(){
return this.pageMaker;
}
public void setPageMaker(PageMaker pageMaker) {
this.pageMaker=pageMaker;
}
public int getPpp(){
return this.ppp;
}
public void setPpp(int ppp) {
this.ppp=ppp;
}
public KindEntityManage getKindEntityManage(){
return this.kindEntityManage;
}
public void setKindEntityManage(KindEntityManage kindEntityManage) {
this.kindEntityManage=kindEntityManage;
}
public KindEntity getKindEntity(){
return this.kindEntity;
}
public void setKindEntity(KindEntity kindEntity) {
this.kindEntity=kindEntity;
}
public List getKindList(){
return this.kindList;
}
public void setKindList(List kindList) {
this.kindList=kindList;
}
public String kindView(){
PageTool pageInfo = new PageTool();
pageInfo.setCur(this.getPpp());
pageInfo.setTotal(this.getKindEntityManage().getRows());
setKindList(this.getKindEntityManage().getKindEntity(pageInfo));
PageMaker pageMaker = new PageMaker();
setPager(pageMaker.makeList(pageInfo,"kindView.action?ppp="));
return SUCCESS;
}
}

相关文章

最新评论