10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Setting Properties for Groups of JSP Pages<br />

178<br />

<strong>The</strong> following sections discuss the properties and explain how they are interpreted for various<br />

combinations of group properties, individual page directives, and web application deployment<br />

descriptor versions.<br />

Deactivating EL Expression Evaluation<br />

Each JSP page has a default mode for EL expression evaluation. <strong>The</strong> default value varies<br />

depending on the version of the web application deployment descriptor. <strong>The</strong> default mode for<br />

JSP pages delivered with a Servlet 2.4 descriptor is to evaluate EL expressions; this automatically<br />

provides the default that most applications want. <strong>The</strong> default mode for JSP pages delivered<br />

using a descriptor from Servlet 2.3 or before is to ignore EL expressions; this provides backward<br />

compatibility. For tag files (see “Encapsulating Reusable Content Using Tag Files” on page 231),<br />

the default is to always evaluate expressions.<br />

You can override the default mode through the isELIgnored attribute of the page directive in<br />

JSP pages and through the isELIgnored attribute of the tag directive in tag files. You can also<br />

explicitly change the default mode by doing one of the following:<br />

■ If you are using the Pages section of the web.xml editor pane in NetBeans IDE:<br />

1. Expand the JSP Property Group node.<br />

2. Select the Ignore Expression Language check box.<br />

■ If you are editing the web.xml file by hand, add an el-ignored element to the<br />

jsp-property-group element in the deployment descriptor and set it to true.<br />

Table 5–8 summarizes the EL evaluation settings for JSP pages.<br />

TABLE 5–8 EL Evaluation Settings for JSP Pages<br />

JSP Configuration Page Directive isELIgnored EL Encountered<br />

Unspecified Unspecified Evaluated if 2.4 web.xml<br />

false Unspecified Evaluated<br />

true Unspecified Ignored<br />

Overridden by page directive false Evaluated<br />

Overridden by page directive true Ignored<br />

Table 5–9 summarizes the EL evaluation settings for tag files.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010<br />

Ignored if

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!