【问题标题】:example display tag with one column as drop down using spring MVC使用 spring MVC 将一列显示为下拉列表的示例
【发布时间】:2011-10-06 21:04:57
【问题描述】:
The following is i'm trying..ListwithMap is passing using spring mvc. 

但无法从列表中提取地图。它显示为空。!

<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>

请帮忙。

【问题讨论】:

    标签: spring model-view-controller tags


    【解决方案1】:

    您需要使用 id 属性来引用显示标签迭代的列表的当前元素:

    <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>
    

    请注意,属性(如 Java 变量)通常以小写字母开头。

    【讨论】:

      猜你喜欢
      • 2018-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-05
      • 1970-01-01
      • 1970-01-01
      • 2017-02-04
      相关资源
      最近更新 更多