问题
To render Map<String, List<MyObject>>
I have a jsp
like this:
....
<nested:iterate property="MyMap" id="entry">
<bean:write name="entry" property="key"/>
<nested:iterate name="entry" property="value" indexId="count" id="myBean">
<div class="">
<nested:define name="myBean" id="myBeanName" property="name"/>
<nested:hidden property="description"></nested:hidden>
<nested:hidden name="myBean" property="name"/>
<nested:checkbox styleId='<%="enabled-"+myBeanName%>' property="enabled"/>
<label for="enabled-<nested:write name="myBeanName" property="name"/>"><nested:write name="myBeanName" property="description"/></label>
</div>
</nested:iterate>
</nested:iterate>
....
The problem here that after compilation into HTML we see wrong name
attribute values although value
attributes are coorect:
...
<div class="">
<input type="hidden" name="value[0].description" value="correct_description">
<input type="hidden" name="name" value="coorect_name">
<input type="checkbox" name="value[0].enabled" value="on" id="correct_value">
<label for="enabled-encDevAddr">correct_description</label>
</div>
...
How to achieve correct values for attribute name
?
来源:https://stackoverflow.com/questions/60940313/how-to-achieve-correct-values-for-attribute-name-when-i-use-nestediteration