Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.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
Java 如何使用JSTL在jsp中的foreach中进行迭代_Java_Jsp_Jstl_Jstl Functions - Fatal编程技术网

Java 如何使用JSTL在jsp中的foreach中进行迭代

Java 如何使用JSTL在jsp中的foreach中进行迭代,java,jsp,jstl,jstl-functions,Java,Jsp,Jstl,Jstl Functions,我有一个hashmap:hashmap=newhashMap(); 其键和条目填写如下。 大学 我想在JSP中迭代映射。分别获取值。 我该怎么做 <c:forEach items="${map}" var="log"> <tr> <td>The Uni:</td> <th><c:out value="${log.key}" /></

我有一个hashmap:
hashmap=newhashMap()
; 其键和条目填写如下。 大学

我想在JSP中迭代映射。分别获取值。 我该怎么做

<c:forEach items="${map}" var="log">
            <tr>
                <td>The Uni:</td>
                <th><c:out value="${log.key}" /></th>
                <td>has following :</td>
                <td><c:out value="${log.value}" />/td>
            </tr>
        </c:forEach>

联合国:
有以下几点:
/td>
我无法使用索引[0]或1或2获取值

我希望输出像这样 “Uni:${name of Uni}的排名${rank}以${best for}而闻名


参数应该取自valueset。

log.value是一个数组。因此,您可以使用c:forEach对其进行迭代。也就是说,如果映射的每个条目都应该是一所大学,有名称、排名和bestFor,那么您不应该有映射。您应该有一个列表。定义类,并使用命名和类型属性。@JBNizet-Okk听起来可行。谢谢