JSP 2.0 技术支持使用表达式语言(EL)。使用 EL,可以更轻松地使用JavaBeans访问应用程序变量。EL 还带有表达式。所述isELIgnored属性值通知容器是否评估或执行EL在JSP或不表达本。
isELIgnored JSP
是 JSP 页面指令支持的 14 个属性之一。
- 如果
isELIgnored="true"
,EL 表达式将被忽略。 - 如果
isELIgnored="false"
,则计算 EL 表达式。
许多 Web 服务器的默认值为true。因此,在 JSP 中使用 EL 时,应将此属性设置为 false 否则不执行。
也可以在web.xml中设定<el-ignored>标签为true来决定不使用EL。例如
<web-app …>
…
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
</jsp-property-group>
</jsp-config>
</web-app>
web.xml
中的<el-ignored>
是用来预设符合<url-pattern>
的JSP网页是否使用EL。
如果web.xml
中的<el-ignored>
与page指令元素的isELIgnored
设定都没有设定,如果web.xml是2.3或以下的版本,不会执行EL,如果是2.4或以上的版本,则会执行EL。
如果设定web.xml中的<el-ignored>
为false
,但不设定page指令元素的isELIgnored
,则会执行EL,如果设定web.xml
中的<el-ignored>
为true
,但不设定page
指令元素的isELIgnored
,则不会执行EL。
如果JSP网页使用page指令元素的isELIgnored
设定是否支援EL,则以page指令元素的设定为主,不管web.xml
中的<el-ignored>
的设定为何。
谨记
Comments | NOTHING