我的动作类中有如下对象列表。
private ArrayList<Employee> emp_list;
public ArrayList<Employee> getEmp_list() {
return emp_list;
}
public void setEmp_list(ArrayList<Employee> emp_list) {
this.emp_list = emp_list;
}
Bean 类:(它有 getter 和 setter)
private String name;
private String designation;
private String project;
现在在 jsp 页面上,我希望将此列表数据显示为在按钮或 href 单击的同一页面上的弹出窗口中的表格(显示列表的大小)。
<body>
<div class="container">
<h2>Modal Example</h2>
<!-- Trigger the modal with a button -->
<table>
<s:iterator value="emp_list">
<tr>
<td><s:property value="name" /></td>
<td>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Display Details</button>
</td>
</tr>
</s:iterator>
</table>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Employee Details</h4>
</div>
<div class="modal-body">
<table>
<tr>
<td>Name</td>
<td><s:property value="name" />
</td>
</tr>
<tr>
<td>Designation</td>
<td><s:property value="designation" />
</td>
</tr>
<tr>
<td>Project</td>
<td><s:property value="project" />
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>
请帮帮我,我卡在这里了。