【发布时间】:2011-05-14 07:29:15
【问题描述】:
我想从 JSTL 读取分配给请求对象的 arrayList 对象属性 我怎样才能做到这一点? 我尝试了以下
这里是servlet代码:
ArrayList<Employee> al = new ArrayList<Employee>();
/* code for filling the ArrayList with objects from class Employee */
request.setAttribute("alldata", al);`
在我的 JSP 页面中:
<jsp:useBean id="alldata" class="java.util.ArrayList" scope="request">
<c:forEach items="alldata" var="item">
<c:out value="item.getName()"></c:out>
</c:forEach>
</jsp:useBean>
但它不起作用,
提前致谢
【问题讨论】: