<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2021/8/9
Time: 23:17
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="Servlet.User"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%
request.setAttribute("name","小明");
User user=new User();
user.setName("小代");
user.setSex("女");
user.setId("18");
session.setAttribute("user",user);
List<User> list=new ArrayList<>();
User user1=new User();
user1.setName("小潘");
user1.setSex("男");
user1.setId("20");
User user2=new User();
user2.setName("小萍");
user2.setSex("女");
user2.setId("19");
list.add(user1);
list.add(user2);
application.setAttribute("list",list);
%>
<%=request.getAttribute("name")%>
<%
User user3=(User) session.getAttribute("user");
String name=user3.getName();
out.write();
%>
</body>
</html>