首页>代码>ssm(spring+Struts2+mybatis)开发CRM客户关系信息管理系统>/F4Crm/src/com/chinasoft/ssm/admin/action/CustomerListAction.java
package com.chinasoft.ssm.admin.action; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.annotation.Autowired; import com.chinasoft.ssm.admin.service.IAdminManageService; import com.chinasoft.ssm.domain.PageBean; import com.opensymphony.xwork2.ActionSupport; public class CustomerListAction extends ActionSupport{ @Autowired private IAdminManageService adminService; private HttpServletRequest request = ServletActionContext.getRequest(); @Override public String execute() throws Exception { //request.setCharacterEncoding("utf-8"); String currentPage = request.getParameter("currentPage");//当前页码 String rows = request.getParameter("rows");//每页显示条数 if(currentPage == null || "".equals(currentPage)){ currentPage = "1"; } if(rows == null || "".equals(rows)){ rows = "8"; } String cst_name = request.getParameter("ctm_name"); String cst_phone = request.getParameter("ctm_phone"); String cst_rank = request.getParameter("ctm_rank"); Map<String, Object> map = new HashMap<String, Object>(); map.put("currentPage", currentPage); map.put("rows", rows); map.put("ctm_name", cst_name); map.put("ctm_phone",cst_phone); map.put("ctm_rank",cst_rank); PageBean pb = adminService.findUserByPage(map); request.getSession().setAttribute("customer",pb); request.getSession().setAttribute("condition",map); return "getSuccess"; } }
