public class CustomerAction {
ICustomerService customerService;
int pager;
Pager page;
public Pager getPage() {
return page;
}
public void setPage(Pager page) {
this.page = page;
}
List customerList;
public int getPager() {
return pager;
}
public void setPager(int pager) {
this.pager = pager;
}
public void setCustomerService(ICustomerService customerService) {
this.customerService = customerService;
}
public void setCustomerList(List customerList) {
this.customerList = customerList;
}
@JSON(serialize = false)
public ICustomerService getCustomerService() {
return customerService;
}
public List getCustomerList() {
return customerList;
}
/**
*查询客户集合
*
* @return String
* @throws Exception
*/
public String queryCustomerList() throws Exception {
page=new Pager();
page.setCount(customerService.queryCount());
page.setPage(pager);
customerList = customerService.queryCustomer(page);
return "querySuccess";
}
Struts 2配置文件 如下: