我在控制台中输出list集合中的数据是正确的,但是在网页上显示是不一致的,请问是什么地方出了问题??,
action中的代码:
public String list(){
List<Department> list = departmentService.selAll();
getValueStack().set("list", list);
System.out.println(list);
// 跳转到列表页面显示
return "list";
}
jsp页面中的主要代码:
<s:iterator value="list" >
<tr class="TableDetail1 template">
<td>
<s:a action="department_list?parentId=%{id}" namespace="/">
${name}
</s:a> </td>
<td>${parent.name} </td>
<td>${description} </td>
<td><s:a onclick="return window.confirm('这将删除所有的下级部门,您确定要删除吗?')" action="department_delete?id=%{id}" namespace="/">删除</s:a>
<s:a action="department_editUI?id=%{id}" namespace="/">修改</s:a>
</td>
</tr>
<script type="text/javascript">
alert("一个记录");
</script>
</s:iterator>
在struts配置action:
<action name="department_*" class="departmentAction" method="{1}">
<result name="list">/WEB-INF/jsp/department/list.jsp</result>
</action>