<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="java.util.ArrayList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
显示结果:
<%
ArrayLsit stu = (ArrayList) request.getAttribute("stus");
//这个地方的ArryList有错,不是已经插入import="java.util.*"了么
%>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="java.util.ArrayList" %>
红色部分有重复,可以去掉下面那行
另外:
ArrayLsit stu = (ArrayList) request.getAttribute("stus");
ArrayList需要指定泛型