日期:2014-05-18  浏览次数:20614 次

struts2如何用动态表格显示后台数据
   jsp部分代码

<body>
<div id="a">
  <table width="830" height="100" border="1" align="center">
  <s:form method="post" action="show">
    <tr>
    <s:submit value="点击查询"></s:submit>
    </tr>
    <tr>
      <td width="128" height="25" align="center"> 书号ID</td>
      <td width="157" align="center">书名</td>
      <td width="147" align="center">作者</td>
      <td width="281" align="center">出版社</td>
    </tr>
    <s:iterator value="#request.list"id="show">
    <tr>
      <td><s:property value="#show.Id"/></td>
      <td><s:property value="#show.bookName"/></td>
      <td><s:property value="#show.writer"/></td>
      <td><s:property value="#show.publisher"/></td>
    </tr>
   </s:iterator>
   </s:form> 
  </table>
</div>
</body>

------解决方案--------------------
不明白什么意思 ,,你上面的代码 不已经是动态的效果了吗 ?