日期:2014-05-17  浏览次数:20723 次

请大家帮我解决一个数据绑定的问题?急啊
html代码如下:
<table border="1">
<tr>
<td>
救援队编号
</td>
<td>
救援队名称
</td>
<td>
编辑
</td>
<td>
删除
</td>
</tr>
<s:iterator value="succorList">
<tr>
<td>
<s:property value="teamid" />
</td>
<td>
<s:property value="teamname" />
</td>
<td>
<s:a
href="uipage/resource/emergencyresource/succor/updatesuccor.jsp?id=%{teamid}&type=%{teamname}"
style="cursour:pointer;">编辑</s:a>
</td>
<td>
<s:a href="Succor.DeleteSuccorAction?id=%{teamid}"
style="cursour:pointer;">删除</s:a>
</td>
</tr>
</s:iterator>
</table>
action如下:
public class SuccorListAction {
public String execute(){
try {
this.setSuccorList(this.succorService.GetSuccorList(new TeaRescue(),0,200));
return "success";
} catch (Exception e) {
e.printStackTrace();
return "failure";
}
}
public List getSuccorList() {
return succorList;
}
public void setSuccorList(List succorList) {
this.succorList = succorList;
}


struct如下:
<action name="listAction" class="com.jp.ep.action.resource.emergencyresource.succor.SuccorListAction">
<result name="success" type="redirect">/uipage/resource/emergencyresource/succor/succorlist.jsp</result>
<result name="failure" type="redirect">/failure.jsp</result>
</action>
问题是,我页面的数据出不来。我调试跟踪succorList是有值的,不知道为什么页面上数据出不来,大家帮我看看吧。

------解决方案--------------------
像这样:
HTML code

<s:iterator value="succorList" id="sucor">
<tr>
    <td>
        <s:property value="#sucor.teamid" />
    </td>
    <td>
        <s:property value="#sucor.teamname" />
    </td>
</s:iterator>