Hello, all...
I'm having trouble figuring out how to access a nested list via the <s:iterator> tag. I understand about nesting the <s:iterator> tag in my
JSP, but my returned list is a little complicated.
My basic list is a list of a type called Record which is basically just a hash map. What I'm trying to accomplish is returning a list that contains some properties of a particular row in a table, and then has some sub-lists of accounts that have hit targets, missed them, or have no data. Note that in the following description square brackets ([) indicate a list and curly braces ({) indicate a Record, which is a hash map. So my basic list item looks like this:
[ {header record}, [{ item1=value, item2=value, item3=value, hits=[{account=, id=}, {account=, id=}...], miss=[{account=, id=}, {account=, id=}...] } ] ]
The hits, miss, and nodata (not shown here) could have any number of accounts or could be an empty list. The super-high level diagram of what my list looks like, taking into account that structure above, looks like this:
[main list: {header record}, [list: {items [list], [list], [list]} ], [list: {items [list], [list], [list]} ], {header record}, [list: {items [list], [list], [list]} ], ... ]
My JSP code, then, to display the data, looks like this:
For the life of me, I can't figure out how to access the list values of "account" and "id" from the "hits" and "misses" list. I've tried the following ways to access them:
<s:iterator value="hits">
<s:iterator value="#hits">
and within the code where the values are used, <s:property value="#hits.account"/> or even <s:property value="%{#hits.account}"/>
Can anyone help me figure out how to access these sub lists? I think that the main issue here is that my list isn't a straight list of lists - there are some items that I need to get for the overall row, and the sublists are just a part of that record. Any ideas would be welcomed, because I'm really at a wall here.