我正在尝试在bean中传递一个arraylist,以便在JSP中由JSTL foreach处理。 我不知道如何为集合指定useBean标记,因为tomcat会重新启动堆栈跟踪异常 java.lang.ClassCastException:java.util.ArrayList无法强制转换为com.business.PersonBeanModel
servlet像这样发送arraylist:
List<PersonBeanModel> people = ManageEmployee.getpeople();
request.setAttribute("jsppeople", people);
JSP包含:
<jsp:useBean id="jsppeople" scope="request" class="com.business.PersonBeanModel" />
<c:forEach items="${jsppeople}" var="myperson">
${myperson.name}
</c:forEach>