我是 jsp 的新手,并且对显示标签的导出功能感兴趣。说,我有这个简单的结构:
public class MyActionBean implements ActionBean{
List<Country> countries;
// getters and setters and some other un-related logic
}
public class Country {
List<String> countryName;
List<Accounts> accounts;
// getters and setters and some other un-related logic
}
public class Accounts {
private FinancialEntity entity;
// getters and setters and some other un-related logic
}
public class FinancialEntity {
String entityName;
// getters and setters and some other un-related logic
}
现在,我想制作一个表格,其中有两列 - 国家名称和实体名称(FinancialEntity)
<display:table id="row" name="${myActionBean.countries}" class="dataTable" pagesize="30" sort="list" defaultsort="8" export="true" requestURI="">
<display:column title="Country" sortable="true" group="1" property="countryName" />
<display:column title="Financial Entity"> somehow get all of the entity names associated with the country? </display:column>
</display:table>
所以,基本上我想遍历账户并获得所有的金融实体。我不知道如何在带有 displaytag 的 JSP 中做到这一点。我尝试使用 c:forEach 和 display:setProperty 标签,但看起来这个标签不是用于这些目的。我被卡住了:(
先感谢您 :)