Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 bean“Result”中,设置了 arrayList“tempList”。然后将这个 bean 设置到会话中。我必须在 JSP 页面上获取 arrayList 元素。
我没有得到如何获取其元素的方法。
请建议。
使用 JSTL <c:forEach>:
<c:forEach>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> ... <c:forEach items="${youSessionAttributeName}" var="i"> Item <c:out value="${i}"/><p> </c:forEach>