isELIgnored=“false“

<%@ page isELIgnored="false"%>的作用

JSP 2.0的一个主要特点是它支持表达语言(expression language)。

JSTL表达式语言可以使用标记格式方便地访问JSP的隐含对象和JavaBeans组件,JSTL的核心标记提供了流程和循环控制功能。自制标记也有自定义函数的功能,因此基本上所有seriptlet能实现的功能都可以由JSP替代。在JSP 2.0中,建议尽量使用EL而使JSP的格式更一致。

在web.xml的<jsp-property-group>中可以控制一组JSP是否使用EL,在每个JSP中也可以指定是否该JSP使用EL。在page directive中的isELIgnored属性用来指定是否忽略。

格式为:

<%@ page isELIgnored="true|false"%>

如果设定为真,那么JSP中的表达式被当成字符串处理。

比如下面这个表达式<p>${2000 % 20}</p>在isELIgnored="true"时输出为${2000 % 20},

而isELIgnored="false"时输出为100。

Web容器默认isELIgnored="false"

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: haoya
  Date: 2023/11/13
  Time: 11:02
  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>
<table>
    <tr>
        <td>编号</td>
        <td>姓名</td>
    </tr>
    <c:forEach items="${list}" var="li">
        <tr>
            <td>${li.id}</td>
            <td>${li.name}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值