Java Web EL JSTL的用法

1.导入包 fastjson-1.2.2.jar

2.JSP文件加入 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

3.用法

// List  
<c:forEach var="id" items="${list}">
     ${id}</br>
    </c:forEach>
    
//Map  JSTL表达式的属性里不能有空格, 遍历的是entrySet(),entrySet 类似 KeyValuePair ,Map类似Dictionary  
    <c:forEach var="entry" items="${map}" >
    
       ${entry.key}:${entry.value}</br>
    </c:forEach>    
    
原文地址:https://www.cnblogs.com/tiancai/p/6035905.html