zTree实现地市县三级级联Action类
ProvinceAction.java:
/** * @Title:ProvinceAction.java * @Package:com.gwtjs.struts.action.area * @Description: * @author:Youhaidong(游海东) * @date:2014-5-11 上午12:27:54 * @version V1.0 */ package com.gwtjs.struts.action.area; import java.util.List; import javax.annotation.Resource; import javax.xml.ws.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import org.springframework.stereotype.Controller; import com.gwtjs.model.Province; import com.gwtjs.service.ProvinceService; import com.gwtjs.struts.BaseAction; /** * 类功能说明 * 类改动者 改动日期 * 改动说明 * <p>Title:ProvinceAction.java</p> * <p>Description:游海东个人开发</p> * <p>Copyright:Copyright(c)2013</p> * @author:游海东 * @date:2014-5-11 上午12:27:54 * @version V1.0 */ @Controller(value="provinceAction") @Scope("prototype") @ParentPackage("json-default") @Namespace(value = "/action/area") public class ProvinceAction extends BaseAction { /** * @Fields serialVersionUID:序列化 */ private static final long serialVersionUID = -2800613278354456551L; /** * 省份编码 */ private String provinceCode; /** * 地市编码 */ private String cityCode; /** * 县级编码 */ private String countyCode; /** * list */ private List<Province> list; /** * provinceService */ @Resource(name = "provinceService") private ProvinceService provinceService; /* (non-Javadoc) * <p>Title:execute</p> * <p>Description:</p> * @return * @throws Exception * @see com.gwtjs.struts.BaseAction#execute() */ @Override @Action(value = "findProvince", results = {@Result(name = "success", type = "json")}) public String execute() throws Exception { list = provinceService.findArea(provinceCode, cityCode, countyCode); return SUCCESS; } /** * @return the provinceCode */ public String getProvinceCode() { return provinceCode; } /** * @param provinceCode the provinceCode to set */ public void setProvinceCode(String provinceCode) { this.provinceCode = provinceCode; } /** * @return the cityCode */ public String getCityCode() { return cityCode; } /** * @param cityCode the cityCode to set */ public void setCityCode(String cityCode) { this.cityCode = cityCode; } /** * @return the countyCode */ public String getCountyCode() { return countyCode; } /** * @param countyCode the countyCode to set */ public void setCountyCode(String countyCode) { this.countyCode = countyCode; } /** * @return the list */ public List<Province> getList() { return list; } /** * @param list the list to set */ public void setList(List<Province> list) { this.list = list; } }