<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>EL执行运算</h1>
<%
pageContext.setAttribute("n1",10);
pageContext.setAttribute("n2",20);
%>
${ n1 + n2 + n3 }
<h3>执行算数运算</h3>
${ n1 < n2 } -- ${ n1 lt n2 }<br>
${ n1 > n2 } -- ${ n1 gt n2 }<br>
${ n1 == n2 } -- ${ n1 eq n2 }<br>
${ n1 >= n2 } -- ${ n1 ge n2 }<br>
${ n1 <= n2 } -- ${ n1 le n2 }<br>
${ n1 != n2 } -- ${ n1 ne n2 }<br>
<h3>执行逻辑运算</h3>
<%
pageContext.setAttribute("n3","30");
pageContext.setAttribute("n4","40");
%>
${ (n1 < n2) && (n3 < n4) -- ${ (n1 < n2) and (n3 < n4) }<br>
${ (n1 < n2) || (n3 < n4) -- ${ (n1 < n2) or (n3 < n4) }<br>
${ !(n1 < n2) } -- ${ not (n1 < n2) }<br>
<h3>执行三元算</h3>
${ n1 < n2 ? "n1小于n2" : "n1不小于n2" }
<h3>空运算符</h3>
${ empty user }<br>
${ not empty user }<br>
</body>
</html>