Note that there are some explanatory texts on larger screens.

plurals
  1. POIterating over list of objects with jsp's displaytag
    text
    copied!<p>I am new to the jsp and interested in display tag for its export functionality. Say, I have this simple structure:</p> <pre><code> public class MyActionBean implements ActionBean{ List&lt;Country&gt; countries; // getters and setters and some other un-related logic } public class Country { List&lt;String&gt; countryName; List&lt;Accounts&gt; 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 } </code></pre> <p>Now, I want to make a table, which will have two columns - country name and entityName(FinancialEntity)</p> <pre><code> &lt;display:table id="row" name="${myActionBean.countries}" class="dataTable" pagesize="30" sort="list" defaultsort="8" export="true" requestURI=""&gt; &lt;display:column title="Country" sortable="true" group="1" property="countryName" /&gt; &lt;display:column title="Financial Entity"&gt; somehow get all of the entity names associated with the country? &lt;/display:column&gt; &lt;/display:table&gt; </code></pre> <p>So, essentially I want to iterate over the accounts and get all the financial entities. I do not know how to do that in JSP with displaytag. I tried to use c:forEach and display:setProperty tag, but it look like this tag is not for these purposes. I am deadly stuck :(</p> <p>Thank you in advance :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload