我想做下分页下面是我的代码
这个是我Action代码我想查询和分页一起做但是得到的结果都是空指针异常说我list方法里面total = es.findtotal(employee);这个employee对象是null可是我不知道怎么解决谁有个好方法教教我谢谢了!
public int getTotalpage() {
return totalpage;
}
public void setTotalpage(int totalpage) {
this.totalpage = totalpage;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String list() {
System.out.println("----------------->listAction");
total = es.findtotal(employee);
System.out.println(total);
totalpage = (total + (3 - 1) / 3);
listEmployee = es.findAllEmployee(employee, page, 3);
return SUCCESS;
}
这个是我JSP页面
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
选择 |
客户ID |
客户姓名 |
客户地址 |
客户电话 |
修改信息 |
value=''> |
|
|
|
|
href='/s:url'>修改 |
|
增加 |
/s:param
/s:url
首页/s:a
上一页/s:param
/s:url
上一页/s:a
/s:param
/s:url
下一页/s:a
/s:param
/s:url
末页/s:a
/s:form
</body>