jsp页面使用logic标签迭代map

来源:互联网 发布:js判断数组不为空 编辑:程序博客网 时间:2024/04/29 14:32

//对map的迭代显示,其中value的值为list类型
<!--对IGPRR01031VO中的对象roleMap进行判断,如存在则执行内部代码-->
<logic:present name="IGPRR01031VO" property="roleMap">
 <!--对roleMap中的内容进行迭代显示-->
 <logic:iterate id="map" name="IGPRR01031VO" property="roleMap"
  indexId="num">
  <!--取出map中的value值-->
  <bean:define id="list" name="map" property="value"
   type="java.util.ArrayList" />
  <!--取出map中的key值-->
  <bean:define id="name" name="map" property="key" />

  <tr>
   <td colspan="3">
   <div class="title">
   <div class="name"><ig:codeValue ccid="ROLE_CATEGORY_CODE"
    cid="${name}" /></div>
   </div>
   </td>
  </tr>
  <tr>
   <!--显示map的key内容,其中${name}即为key值-->
   <th width="30%"><label> <input type="checkbox"
    name="${name}" id="${name}"
    onclick="selectAll('${name}','${name}roleids')" /> </label></th>
   <th width="40%">部门名称</th>
   <th width="30%">主办部门</th>
  </tr>
  <!--迭代与key对应的list值-->
  <logic:iterate id="v" name="list" indexId="index">
   <tr class="<ig:rowcss index="${index}"/>">
    <td height="20"><label> <input type="checkbox"
     name="${name}roleids" value="${v.roleid}"> </label></td>
    <td>${v.rolename}</td>
    <td><html:radio property="ppsuper" value="${v.roleid}"
     name="IGPRR0102Form" styleId="ppsuper" /></td>
   </tr>
  </logic:iterate>
 </logic:iterate>

</logic:present>

原创粉丝点击