首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

jquery json ajax事例

2012-10-29 
jquery json ajax例子配置文件对应的actionpackage jp.co.syspro.action.ajaximport java.util.Listimpo

jquery json ajax例子



配置文件


对应的action
package jp.co.syspro.action.ajax;import java.util.List;import jp.co.syspro.common.module.LabelValueBean;import jp.co.syspro.common.util.JsonUtil;import jp.co.syspro.service.ajax.AjaxService;import com.opensymphony.xwork2.ActionSupport;@SuppressWarnings("unchecked")public class AjaxAction extends ActionSupport {private static final long serialVersionUID = -5057041300197154859L;private AjaxService ajaxService = null;/** * エリア */private String area;/** * 区 */private String district;/** * 都道府県 */private String prefecture;/** * 市町村 */private String adArea;private List<LabelValueBean> optionList = null;/** * 全てエリア取得 *  * @return エリアリスト * @throws Exception */public String getAllArea() throws Exception {optionList = ajaxService.getArea();JsonUtil.sendJson(optionList);return null;}/** * エリアによる 区取得 *  * @return 区リスト * @throws Exception */public String getDistrictByAreaCd() throws Exception {optionList = ajaxService.getDistrictByAreaCd(area);JsonUtil.sendJson(optionList);return null;}/** * 区によって 店舗取得 *  * @return 店舗リスト * @throws Exception */public String getTenpoByDistrictCd() throws Exception {optionList = ajaxService.getTenpoByDistrictCd(district);JsonUtil.sendJson(optionList);return null;}/** * 全てadエリア取得 *  * @return adエリアリスト * @throws Exception */public String getAdArea() throws Exception {optionList = ajaxService.getAdArea();JsonUtil.sendJson(optionList);return null;}/** * adエリアによる 都道府県取得 *  * @return 都道府県スト * @throws Exception */public String getPrefectureByAreaCd() throws Exception {optionList = ajaxService.getPrefectureByAreaCd(adArea);JsonUtil.sendJson(optionList);return null;}/** * 都道府県によって 市町村取得 *  * @return 市町村リスト * @throws Exception */public String getCityByPrefectureCd() throws Exception {optionList = ajaxService.getCityByPrefectureCd(prefecture);JsonUtil.sendJson(optionList);return null;}public String getDistrict() {return district;}public void setDistrict(String district) {this.district = district;}public void setArea(String area) {this.area = area;}public String getArea() {return area;}public AjaxService getAjaxService() {return ajaxService;}public void setAjaxService(AjaxService ajaxService) {this.ajaxService = ajaxService;}public String getPrefecture() {return prefecture;}public void setPrefecture(String prefecture) {this.prefecture = prefecture;}public void setAdArea(String adArea) {this.adArea = adArea;}public List<LabelValueBean> getOptionList() {return optionList;}public void setOptionList(List<LabelValueBean> optionList) {this.optionList = optionList;}}


[img][/img]

热点排行