作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有两个数组列表。员工名单和分配名单。
每个员工都有分配 list 。Employee
类如下。
public class Employee {
private int id;
private String firstname;
private String lastname;
private List<Allocation> allocationList ;
// geters and setters
}
Allocation
类如下
public class Allocation {
private int categoryId;
private String categoryName;
private float allocation;
// getters and setters
}
最佳答案
好的。所以我自己想通了。下面是工作代码。
<display:table name="employeeList" pagesize="25" class="listingTable" keepStatus="true" cellpadding="0px"
cellspacing="0px" id="employee" export="true" requestURI="">
<display:setProperty name="export.decorated" value="true" />
<display:setProperty name="export.excel.filename" value="${exportFileName}.xls" />
<c:forEach var="cl" items="${selectedColumnList}">
<display:column property="${cl.property}" title="${cl.title}" format="${cl.format}" />
</c:forEach>
<c:forEach var="allocationCl" items="${allocationCategoryList}" varStatus="status">
<c:set var="allocationCounter" value="${status.index}" />
<display:column title="${allocationCl.category}">
<c:choose>
<c:when test="${fn:length(employee.allocations) ne '0' }">
${employee.allocations[allocationCounter].allocation}
</c:when>
<c:otherwise>
0
</c:otherwise>
</c:choose>
</display:column>
</c:forEach>
<display:setProperty name="paging.banner.item_name" value="Employee" />
<display:setProperty name="paging.banner.items_name" value="Employees" />
</display:table>
关于jsp - 如何在 JSP 上使用显示标签显示嵌套数组列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11358422/
我是一名优秀的程序员,十分优秀!