随笔-10  评论-23  文章-32  trackbacks-0

jsp中,static是一个对象列表:

<s:iterator value="tacticList" status="tactic">
<dl>
<s:hidden name="tacticList[%{#tactic.index}].id" value="%{tacticList[#tactic.index].id}" />
<s:textfield name="tacticList[%{#tactic.index}].name" value="%{tacticList[#tactic.index].name}"/>:
<s:set name="list" value="#{'true':'是','false':'否'}" />
<s:radio list="list" listKey="key" listValue="value" name="tacticList[%{#tactic.index}].value"
value
="%{tacticList[#tactic.index].value}"></s:radio>
</dl>
</s:iterator>

----------------------------------

action中,使用一个和jsp中同名的对象列表tacticList,get/set方法,接受提交的数据:

 private List<OMDefaultTactic> tacticList;

public List<OMDefaultTactic> getTacticList() {
return tacticList;
}

public void setTacticList(List<OMDefaultTactic> tacticList) {
this.tacticList = tacticList;
}
posted on 2009-08-04 15:56 liuyimx 阅读(1431) 评论(0)  编辑  收藏 所属分类: struts2

只有注册用户登录后才能发表评论。


网站导航: