background image

Deactivating EL Expression Evaluation

<< Setting Properties for Groups of JSP Pages | Declaring Page Encodings >>
<< Setting Properties for Groups of JSP Pages | Declaring Page Encodings >>

Deactivating EL Expression Evaluation

The following sections discuss the properties and explain how they are interpreted for various
combinations of group properties, individual page directives, and web application deployment
descriptor versions.
Deactivating EL Expression Evaluation
Each JSP page has a default mode for EL expression evaluation. The default value 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. For tag files (see
"Encapsulating Reusable Content Using Tag Files" on page 233
),
the default is to always evaluate expressions.
You can override the default mode through the isELIgnored attribute of the page directive in
JSP pages and through the isELIgnored attribute of the tag directive in tag files. You can also
explicitly change the default mode by doing one of the following:
If you are using the Pages section of the web.xml editor pane in NetBeans IDE:
1. Expand the JSP Property Group node.
2. Select the Ignore Expression Language check box.
If you are editing the web.xml file by hand, add an el-ignored element to the
jsp-property-group
element in the deployment descriptor and set it to true.
Table 5­8
summarizes the EL evaluation settings for JSP pages.
TABLE 5­8
EL Evaluation Settings for JSP Pages
JSP Configuration
Page Directive isELIgnored
EL Encountered
Unspecified
Unspecified
Evaluated if 2.4 web.xml
Ignored if <= 2.3 web.xml
false
Unspecified
Evaluated
true
Unspecified
Ignored
Overridden by page directive
false
Evaluated
Overridden by page directive
true
Ignored
Table 5­9
summarizes the EL evaluation settings for tag files.
Setting Properties for Groups of JSP Pages
The Java EE 5 Tutorial · September 2007
180