我有以下用法,使用Stuts2和jquery粉::
jsp:
<s:url id="ajaxActionUrl" value="/getStateCodesJson"/>
<sj:select name="stateCodeId"
id="stateCodeId"
label="State"
href="%{ajaxActionUrl}"
onChangeTopics="reloadSecondSelect"
list="stateCodeList"
listKey="id"
listValue="label"
emptyOption="true"
headerKey="-1"
headerValue="Please Select A State"/>
<sj:select name="subCodeId"
id="subCodeId"
label="Sub Feature"
href="%{ajaxActionUrl}"
formIds="mapGeneratorForm"
reloadTopics="reloadSecondSelect"
list="subCodeList"
listKey="id"
listValue="subCodeDescription"
emptyOption="true"
headerKey="-1"
headerValue="Please Select A Code"/>
行动:
@Action(value = "getStateCodesJson", results = {
@Result(name = "success", type = "json")
})
public String getStateCodesJson() throws Exception {
stateCodeList = stateCodeService.getAll();
Collections.sort(stateCodeList);
if (stateCodeId != null) {
StateCode stateCode = stateCodeService.getById(stateCodeId);
subCodeList = subCodeService.getByStateCode(stateCode);
}
return SUCCESS;
}
当jsp第一负荷时,“SedStateCodesJson()”方法被称作3。 然而,在作出这一改变之后,不再要求采取行动,因此第二次行动从未有人居住。
谁能帮助?
son