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

 我来答
we...8@33sn.cc
2017-05-16
知道答主
回答量:67
采纳率:0%
帮助的人:18.5万
展开全部
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;
}
没有任何问题
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式