example display tag with one column as drop down using spring MVC
The following is i'm trying..ListwithMap is passing using spring mvc.
But unable to extract Map from the list. it displays empty开发者_如何转开发.!
<display:table name="ListwithMap" >
------
------
<display:column sortable="false" titleKey="dropdown.name" style="width: 15%">
<select name="s" id="s" >
<c:forEach items="${Map}" var="x">
<c:out value="${x.key}"/>
</c:forEach>
</select>
</display:column>
</display:table>
Please help.
You need to use the id attribute to have a reference to the current element of the list on which the display tag iterates:
<display:table name="ListwithMap" id="currentElement">
<display:column sortable="false" titleKey="dropdown.name" style="width: 15%">
<select name="s" id="s" >
<c:forEach items="${currentElement}" var="x">
<c:out value="${x.key}"/>
</c:forEach>
</select>
</display:column>
</display:table>
Note that attributes, like Java variables, conventionally start with a lower-case letter.
精彩评论