在<c:forEach ></c:forEach>中如何定义数组变量,请jstl高手指导

/c:forEach中如何定义数组变量,请jstl高手指导

 <%
    String[] colors = new String[] { "red", "green", "yellow", "black","silver" };
    pageContext.setAttribute("colors", colors);
%>

<c:forEach var="color" items="${pageScope.colors}">
    <c:if test="${color=='yellow'}">
        <c:out value="${color}" />
    </c:if>
</c:forEach>

http://blog.csdn.net/chinacsharper/article/details/39855287