标签:
杂谈 |
分类: ssh |
ibatis分页实现主要步骤:
a. 创建Page类。
b.创建bean类,并继承Page类。
b. 在dao层,定义两个方法。并实现该方法。
c. 在业务层,同样定义两个方法。并实现它。
d. 在配置文件中注入有关的page类。并设置相应的get和set方法。
e. 在action中调用有关的方法。
f.进行配置文件的设置。
详细步骤:
1. Page类
package com.exeerp.sm.bean;
public class Page
{
private
int pagesize;//单页记录
private
int currentpage = 1;//当前页面
private
int countdate;//总记录数
private
int lastPage;
private
int nextPage;
private
int countPage;
public
int
getCurrentpage()
{
return
currentpage;
}
public
void
setCurrentpage(int
currentpage)
{
if(currentpage>getCountpage())
{
this.currentpage
= getCountpage();
}else
{
if(currentpage
< 1)
a. 创建Page类。
b.创建bean类,并继承Page类。
b. 在dao层,定义两个方法。并实现该方法。
c. 在业务层,同样定义两个方法。并实现它。
d. 在配置文件中注入有关的page类。并设置相应的get和set方法。
e. 在action中调用有关的方法。
f.进行配置文件的设置。
详细步骤:
1.
package com.exeerp.sm.bean;
public class Page
{