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.

TABLE 5–9 EL Evaluation Settings for Tag Files<br />

Tag Directive isELIgnored EL Encountered<br />

Unspecified Evaluated<br />

false Evaluated<br />

true Ignored<br />

Declaring Page Encodings<br />

You set the page encoding of a group of JSP pages using the JSP property group configuration in<br />

the deployment descriptor 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. Enter the page encoding in the Page Encoding field.<br />

■ If you are editing the web.xml file by hand, add a page-encoding element to the<br />

jsp-property-group element in the deployment descriptor and set it to one of the valid<br />

character encoding codes, which are the same as those accepted by the pageEncoding<br />

attribute of the page directive.<br />

A translation-time error results if you define the page encoding of a JSP page with one value in<br />

the JSP configuration element and then give it a different value in a pageEncoding directive.<br />

Defining Implicit Includes<br />

Setting Properties for Groups of JSP Pages<br />

You can implicitly include preludes and codas for a group of JSP pages by adding items to the<br />

Include Preludes and Codas lists. <strong>The</strong>ir values are context-relative paths that must correspond<br />

to elements in the web application. When the elements are present, the given paths are<br />

automatically included (as in an include directive) at the beginning and end, respectively, of<br />

each JSP page in the property group. When there is more than one include or coda element in a<br />

group, they are included in the order they appear. When more than one JSP property group<br />

applies to a JSP page, the corresponding elements will be processed in the same order as they<br />

appear in the JSP configuration section.<br />

For example, the Duke’s Bookstore application uses the files /template/prelude.jspf and<br />

/template/coda.jspf to include the banner and other boilerplate in each screen. To add these<br />

files to the Duke’s Bookstore property group using the deployment descriptor, follow these<br />

steps:<br />

1. In NetBeans IDE, expand your project’s folder in the Projects pane.<br />

2. Expand the Web Pages node and then the WEB-INF node.<br />

3. Double-click web.xml to open it in the editor pane.<br />

4. Click Pages at the top of the editor pane.<br />

Chapter 5 • <strong>Java</strong>Server PagesTechnology 179

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

Saved successfully!

Ooh no, something went wrong!