Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops 如何在JSTL中使用索引变量迭代LinkedHashMap_Loops_Jstl_Linkedhashmap - Fatal编程技术网

Loops 如何在JSTL中使用索引变量迭代LinkedHashMap

Loops 如何在JSTL中使用索引变量迭代LinkedHashMap,loops,jstl,linkedhashmap,Loops,Jstl,Linkedhashmap,您能建议如何使用索引变量迭代LinkedHashMap吗。 重要的是,我使用索引变量来迭代映射。 我需要索引来访问同一映射中其他地方的值 Map<String,List<String>> map = new LinkedHashMap<String,List<String>>(); Map Map=newlinkedhashmap(); 我已经编写了java代码。并努力在JSTL中转换此代码 int listcount = 8; fo

您能建议如何使用索引变量迭代LinkedHashMap吗。 重要的是,我使用索引变量来迭代映射。 我需要索引来访问同一映射中其他地方的值

Map<String,List<String>> map = new LinkedHashMap<String,List<String>>();    
Map Map=newlinkedhashmap();
我已经编写了java代码。并努力在JSTL中转换此代码

int listcount = 8;

for (Map.Entry<String, List<String>> entry : map.entrySet())
{               

          List<String> lst = new ArrayList<String>();
          lst= entry.getValue();
          System.out.println(":::::::"+entry.getKey()+":::::::");

          for(int i=0;i<listcount;i++){                     
                        System.out.println(lst.get(i));
                        System.out.println(map.get(entry.getKey()+"New").get(i));                       

           }    

}
int listcount=8;
对于(Map.Entry:Map.entrySet())
{               
List lst=new ArrayList();
lst=entry.getValue();
System.out.println(“:::”+entry.getKey()+”::::”;
对于(inti=0;我对不起,我已经弄明白了。
这是解决办法

<c:forEach items="${rmqList}" var="entry" varStatus="i">
                    <c:set var="editedfieldkey" value="${entry.key}New"/>
                <tr>
                        <td>${entry.key}</td>


                        <c:forEach items="${entry.value}" var="item" varStatus="j">
                            <c:if test="${item ne null }">      
                                <td>Value: ${item} <td>
                                <td>Edited Value ${rmqList[editedfieldkey][j.index]}</td>
                            </c:if>
                        </c:forEach>
                    </tr>
                </c:forEach>              

${entry.key}
值:${item}
编辑值${rmqList[editedfieldkey][j.index]}
<c:forEach items="${rmqList}" var="entry" varStatus="i">
                    <c:set var="editedfieldkey" value="${entry.key}New"/>
                <tr>
                        <td>${entry.key}</td>


                        <c:forEach items="${entry.value}" var="item" varStatus="j">
                            <c:if test="${item ne null }">      
                                <td>Value: ${item} <td>
                                <td>Edited Value ${rmqList[editedfieldkey][j.index]}</td>
                            </c:if>
                        </c:forEach>
                    </tr>
                </c:forEach>