在后端,我有一张地图:
SortedMap<String, List<MyObject>> myMap = new TreeMap<>()
MyObject具有private String name公共获取器和设置器的字段
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="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>