在后端,我有一个地图:
SortedMap<String, List<MyObject>> myMap = new TreeMap<>()
[MyObject
的private String name
字段带有公共获取程序和设置程序
在jsp上,我有:
<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>
但是我看到错误:
Caused by: javax.servlet.jsp.JspException: No getter method for property: "otherBean.MyMap(API).listElement" of bean: "MyBeanForm"
我该如何解决?
有效
<nested:iterate property="myMap" id="map">
<bean:write name="map" property="key"/>
<nested:iterate property="value" name="map" id="obj">
<bean:write name="obj" property="name"/>
</nested:iterate>
</nested:iterate>