问题
On Backend side I have a Map:
SortedMap<String, List<MyObject>> myMap = new TreeMap<>()
MyObject
has private String name
field with pulic getter and setter
On jsp I have:
<nested:iterate property="myMap" id="map">
<bean:write name="map" property="key"/>
<nested:iterate property="listElement" id="value">
<bean:write name="value" property="name"/>
</nested:iterate>
</nested:iterate>
But I see error:
Caused by: javax.servlet.jsp.JspException: No getter method for property: "otherBean.MyMap(API).listElement" of bean: "MyBeanForm"
How could I fix it ?
回答1:
It works
<nested:iterate property="myMap" id="entry">
<bean:write name="entry" property="key"/>
<nested:iterate property="value" name="entry" id="obj">
<bean:write name="obj" property="name"/>
</nested:iterate>
</nested:iterate>
来源:https://stackoverflow.com/questions/60889028/how-to-iterate-over-mapstring-listmyobject-in-the-jsp-using-struts-tag-libr