2
使用Countries
類型,它是一個bean類使用下面的代碼時,我只得到了一個空白頁面輸出的ArrayList
:印刷的ArrayList使用JSTL在JSP
<%
ArrayList<Countries> countryList = (ArrayList<Countries>) request.getAttribute("al");
%>
<c:forEach items="${countryList}" var="item">
<c:out value="${item.code}"></c:out>
<c:out value="${item.name}"></c:out>
</c:forEach>
沒有必要在請求屬性的請求範圍內再次刷新列表作爲它已經存在。 – Gautam