El01.jsp
在这里插入代码片
```<body>
<%
session.setAttribute("name","李四");
request.setAttribute("lala","张三");
application.setAttribute("age",26);
pageContext.setAttribute("str","lala");
%>
${sessionScope.name}
${requestScope.lala}
${applicationScope.age}
${pageScope.str}
</body>
运行结果
李四 张三 26 lala
El02.jsp
在这里插入代码片
<body>
${3>4}
<h3>算数运算符</h3>
${3+4}
${3/4}
${3 div 4}
${3%4}
${3 mod 4}
<h3>比较运算符</h3>
${3==4}
<h3>逻辑运算符</h3>
${3>4 &&3<4}
${3>4 and 3<4}
<h4>empty运算符</h4>
<%
String str="";
request.setAttribute("str",str);
List list= new List();
request.setAttribute("list",list);
%>
${empty str}
${empty list}
${not empty str}
${not empty list}
</body>
运行结果
false
算数运算符
7 0.75 0.75 3 3
比较运算符
false
逻辑运算符
false false
empty运算符
true false false true