items="map"这个是不是应该是items="${map}",确定了这个再说其他的。

解决方案 »

  1.   


    <c:forEach items='${map}' var='mapItem'>   <%-- Remember that items in a Hashtable don't necessarily        come out in the same order they went in. --%>        (<c:out value='${mapItem.key}'/>         <c:out value='${mapItem.value}'/>)</c:forEach>
      

  2.   

    map用key和value的键值对的形式来遍历你的这个:
    <c:forEach items="map" var="item" varStatus="s"> 
    应该是
    <c:forEach items="${map}" var="item" varStatus="s"> 
      

  3.   

    标记里面的东西不能按照平时JSP代码那样去理解 <c:out value="${s.index}"/>按照JSP去理解的话写成
    <c:out value="s.index"/>就可以了,
     <c:out value="${item[s.index]}"/> 试下改为<c:out value="${item[${s.index}]}"/>
    如果不行,那就是标记不支持双层嵌套.
      

  4.   

    <?xml version="1.0" encoding="UTF-8" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" 
      xmlns:c="http://java.sun.com/jsp/jstl/core" 
      version="2.0">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>c:forEach Example</title>
      </head>
      <body>
        <table>
          <c:forEach var="person" items="${people.people}">
            <tr>
              <td>${person.name}</td>
              <td>${person.age}</td>
              <td>${person.height}</td>
            </tr>
          </c:forEach>
        </table>
      </body>
    </html> <?xml version="1.0" encoding="UTF-8" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" 
      xmlns:c="http://java.sun.com/jsp/jstl/core" 
      version="2.0">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>c:forEach Example</title>
      </head>
      <body>
        <table>
          <c:forEach var="person" items="${people.people}" varStatus="rowCounter">
            <c:choose>
              <c:when test="${rowCounter.count % 2 == 0}">
                <c:set var="rowStyle" scope="page" value="odd"/>
              </c:when>
              <c:otherwise>
                <c:set var="rowStyle" scope="page" value="even"/>
              </c:otherwise>
            </c:choose>
            <tr class="${rowStyle}">
              <td>${person.name}</td>
              <td>${person.age}</td>
              <td>${person.height}</td>
            </tr>
          </c:forEach>
        </table>
      </body>
    </html>