1、webwork分页例子含JSPXMLaction1. JAVA1.1 FORMpackage lan;import java.util.List;import com.nl.bss.form.BVBaseForm;public class YardConfigForm extends BVBaseForm private String schoolName; private String schoolCode; private String m_operator_id;/ 修改的操作员 private String USE_FLAG; private String modifyDate; pr
2、ivate String operator_id; / 原操作员 private String changedate;/ 修改时间 private String appDate; private String x_Code;/ 小区代码 private String x_Name;/ 小区名 private String yardName;/ 校区名称 private String yardCode;/ 校区代码 private int currentPage = 1;/当前页 public String getYardName() return yardName; public void s
3、etYardName(String yardName) this.yardName = yardName; public String getYardCode() return yardCode; public void setYardCode(String yardCode) this.yardCode = yardCode; public String getAppDate() return appDate; public void setAppDate(String appDate) this.appDate = appDate; public String getChangedate(
4、) return changedate; public void setChangedate(String changedate) this.changedate = changedate; public String getOperator_id() return operator_id; public void setOperator_id(String operator_id) this.operator_id = operator_id; public String getModifyDate() return modifyDate; public void setModifyDate
5、(String modifyDate) this.modifyDate = modifyDate; public String getSchoolName() return schoolName; public void setSchoolName(String schoolName) this.schoolName = schoolName; public String getSchoolCode() return schoolCode; public void setSchoolCode(String schoolCode) this.schoolCode = schoolCode; pu
6、blic String getM_operator_id() return m_operator_id; public void setM_operator_id(String m_operator_id) this.m_operator_id = m_operator_id; public String getUSE_FLAG() return USE_FLAG; public void setUSE_FLAG(String use_flag) USE_FLAG = use_flag; public void reset() schoolName = ; schoolCode = ; m_o
7、perator_id = ; USE_FLAG = ; modifyDate = ; operator_id = ; x_Code = ; x_Name = ; yardName = ; yardCode = ; public String getX_Code() return x_Code; public void setX_Code(String code) x_Code = code; public String getX_Name() return x_Name; public void setX_Name(String name) x_Name = name; public int
8、getCurrentPage() return currentPage; public void setCurrentPage(int currentPage) this.currentPage = currentPage; 1.2 ACTIONjavaAction:package lan;import java.math.BigDecimal;import java.sql.Timestamp;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;import java.util.
9、Iterator;import java.util.List;import java.util.Map;import javax.servlet.http.HttpSession;import webss.utils.WEBSSUtil;import biz_management.global.Operator_DT;import com.nl.base.utils.DBTools;import com.nl.bss.action.BVBaseAction;import com.nl.bss.mgmt.BVBaseService;import com.nl.bss.utils.GlobalCo
10、nst;import com.opensymphony.webwork.ServletActionContext;import com.opensymphony.xwork.ActionContext;import com.opensymphony.xwork.ModelDriven;public class YardConfigAction extends BVBaseAction implements ModelDriven private BVBaseService service; private YardConfigForm form; private List RList; pub
11、lic List getRList() return RList; public void setRList(List list) RList = list; public YardConfigForm getForm() return form; public void setForm(YardConfigForm form) this.form = form; /* * return the service */ public BVBaseService getService() return service; /* * param service * the service to set
12、 */ public void setService(BVBaseService service) this.service = service; public String page_init() throws Exception / 从session中取出地市号 try form.reset(); return this.showYard(); catch (Exception e) / TODO Auto-generated catch block form.setErrorMessage(系统忙,请稍候再试!); return fail; /* * (non-Javadoc) * *
13、see com.opensymphony.xwork.ActionSupport#execute() */ public String showYard() throws Exception / 从session中取出地市编号 try HttpSession session = ServletActionContext.getRequest().getSession(); Operator_DT operatorInfo = (Operator_DT) session .getAttribute(operatorInfo); int cityId = operatorInfo.city_id;
14、 int countryId = operatorInfo.county_id; this.args.put(GlobalConst.KEY_IS_LOG, true); / 设置是否需要写日志 this.args.put(GlobalConst.KEY_PAGE_METHOD, showSum); / 操作方法决定SC需要调用的方法 this.args.put(CITYID,cityId+); this.args.put(COUNTRYID,countryId+); this.args.put(NAME,form.getSchoolName(); this.args.put(CODE,form.getSchoolCode(); this.args.put(YARDCODE,form.getYardCode(); this.args.put(YARDNAM
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1