这个是把数据交给index.html遍历出来
public String showAllPro(){
List<Product> proList = ps.getAllPro();
ActionContext.getContext().put("proList", proList);
return "data";
}
INDEX.HTML
<%@ taglib uri="/struts-tags" prefix="s" %>
<s:form action="ProAction_delPro"> <table border="1"> <s:iterator value="proList"> <tr> <td><s:checkbox name="proId" value="false" fieldValue="%{proId}" /></td> <td><s:property value="proName"/></td> <td><s:property value="proPrice"/></td> <td><s:property value="proCount"/></td> <td><s:property value="proDesc"/></td> </tr> </s:iterator> <tr> <td colspan="5"><s:submit label="删除" /></td> </tr> </table> </s:form>