Action中的list和Jsp中的<s:select>标签怎么进行传值

如题所述

1.很有可能你查出来的是空,所以没法循环
2.我测试了下,改动下Action代码
List<DptSelectBean> selectBeanList =new ArrayList<DptSelectBean>();
public List<DptSelectBean> getSelectBeanList() {
return selectBeanList;
}

public void setSelectBeanList(List<DptSelectBean> selectBeanList) {
this.selectBeanList = selectBeanList;
}

@Override
public String execute() throws Exception {
// selectBeanList = accountAddService.dptSelect();
DptSelectBean d1=new DptSelectBean();
d1.setDepartmentID(1);
d1.setDepartmentName("a");
DptSelectBean d2=new DptSelectBean();
d2.setDepartmentName("b");
d2.setDepartmentID(2);
selectBeanList.add(d1);
selectBeanList.add(d2);
// setSelectBeanList(selectBeanList);

return SUCCESS;
}
没有任何问题
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答