background image

Literal Expressions

<< Deactivating Expression Evaluation | Composite Expressions >>
<< Deactivating Expression Evaluation | Composite Expressions >>

Literal Expressions

<jsp-property-group>
<deferred-syntax-allowed-as-literal>
true
</deferred-syntax-allowed-as-literal>
</jsp-property-group>
or
<jsp-property-group>
<el-ignored>true</el-ignored>
</jsp-property-group>
Finally, you can configure the page with the page directive to either accept the #{ characters as
String
literals with the deferredSyntaxAllowedAsLiteral attribute, or to ignore all EL
expressions using the isELIgnored attribute:
<%@page ... deferredSyntaxAllowedAsLiteral=
"true" %>
or
<%@ page isELIgnored =
"true" %>
The valid values of these attributes are true and false. If isELIgnored is true, EL expressions
are ignored when they appear in static text or tag attributes. If it is false, EL expressions are
evaluated by the container only if the attribute has rtexprvalue set to true or the expression is
a deferred expression.
The default value of isELIgnored varies depending on the version of the web application
deployment descriptor. The default mode for JSP pages delivered with a Servlet 2.4 descriptor is
to evaluate EL expressions; this automatically provides the default that most applications want.
The default mode for JSP pages delivered using a descriptor from Servlet 2.3 or before is to
ignore EL expressions; this provides backward compatibility.
Literal Expressions
A literal expression evaluates to the text of the expression, which is of type String. It does not
use the ${} or #{} delimiters.
Unified Expression Language
The Java EE 5 Tutorial · September 2007
158