您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
09_EL_概述(el的简单使用)
发布时间:2022-09-10 13:19:30编辑:雪饮阅读()
所谓el其实也只是“模板标签”中的一种小部件了。
如el.jsp:
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2022/9/10
Time: 13:07
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>
${3>4}
</body>
</html>
被访问时候页面上显示false
那么el标签也可以被忽略的,比如在一个jsp页面中忽略所有el表达式的解析。
el2.jsp:
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2022/9/10
Time: 13:08
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="true" %>
<html>
<head>
<title>Title</title>
</head>
<body>
${3>4}
${4>3}
</body>
</html>
将在浏览器原样显示:
${3>4} ${4>3}
el表达式也支持仅忽略某个el表达式,el3.jsp如:
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2022/9/10
Time: 13:09
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>
${3>4}
\${3>4}
</body>
</html>
将在浏览器中解析为:
false ${3>4}
关键字词:EL,概述,使用