🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
![](https://box.kancloud.cn/ca127c429582b4ffb2504fca25390331_597x109.png) ![](https://box.kancloud.cn/a9c178af6bd80c207c900a62d9d9fe4d_932x337.png) ![](https://box.kancloud.cn/064bacbfd9c20579671e039eefd8ecd2_619x275.png) 实例 el.jsp ~~~ <%@ page import="zyw.bean.User" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.List" %><%-- Created by IntelliJ IDEA. User: Administrator Date: 2018/7/14 Time: 15:03 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Title</title> </head> <body> <% pageContext.setAttribute("name","xiaoming"); request.setAttribute("name","小明"); User user = new User();//IDEA导包快捷键Art+enter user.setName("小花"); user.setSex("女"); session.setAttribute("user",user); List<User> list=new ArrayList<>(); User user1=new User(); user1.setName("小强"); user1.setSex("男"); User user2=new User(); user2.setName("小丽"); user2.setSex("女"); 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(name); %> <% List<User> list1=(List<User>)application.getAttribute("list"); User user4=list1.get(0); out.write(user4.getName()); %> ${requestScope.name} ${sessionScope.user.name} ${applicationScope.list[0].name} ${name} ${user.name} ${list[0].name} </body> </html> ~~~ ![](https://box.kancloud.cn/27c73fe625859b3d3ddb36e4668421f4_662x128.png)