问题描述
- 用widow.location.href发出的请求,action里的list不能在页面遍历
- js部分
function selectcountry(){
var countryid = document.getElementById(""cid"").value;
window.location.href=""countryDetil?countryID=""+countryid;
}<ul> <s:iterator value=""countrySchool""> <li><a href=""#""><img src=""${qmOLLXSPIC }""> <h3>${qmOLLXSchineseName}</h3></a></li> </s:iterator> <div class=""clear""></div> </ul>
action里的方法
private List countrySchool;
public String countryDetils(){
this.onload();
HttpServletRequest request = ServletActionContext.getRequest();
String a = request.getParameter(""countryID"");
country = (QMOLCountry) service.getOneByID(QMOLCountry.class Integer.parseInt(a));
PageObject page = service.getListByPageBySize(QMOLLXSchool.class qmOLCountry.id=""+Integer.parseInt(a) 5 1);
countrySchool = QMGeneralTools.changList(page.getList() QMOLLXSchool.class);
return QMConstants.ACTION_SUCCESS;
}private List<QMOLLXSchool> getCountrySchool() { return countrySchool;}private void setCountrySchool(List<QMOLLXSchool> countrySchool) { this.countrySchool = countrySchool;}
时间: 2025-01-10 21:22:47