background image

Declaring Page Encodings

<< Deactivating EL Expression Evaluation | Eliminating ExtraWhite Space >>
<< Deactivating EL Expression Evaluation | Eliminating ExtraWhite Space >>

Declaring Page Encodings

TABLE 5­9
EL Evaluation Settings for Tag Files
Tag Directive isELIgnored
EL Encountered
Unspecified
Evaluated
false
Evaluated
true
Ignored
Declaring Page Encodings
You set the page encoding of a group of JSP pages using the JSP property group configuration in
the deployment descriptor 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. Enter the page encoding in the Page Encoding field.
If you are editing the web.xml file by hand, add a page-encoding element to the
jsp-property-group
element in the deployment descriptor and set it to one of the valid
character encoding codes, which are the same as those accepted by the pageEncoding
attribute of the page directive.
A translation-time error results if you define the page encoding of a JSP page with one value in
the JSP configuration element and then give it a different value in a pageEncoding directive.
Defining Implicit Includes
You can implicitly include preludes and codas for a group of JSP pages by adding items to the
Include Preludes and Codas lists. Their values are context-relative paths that must correspond
to elements in the web application. When the elements are present, the given paths are
automatically included (as in an include directive) at the beginning and end, respectively, of
each JSP page in the property group. When there is more than one include or coda element in a
group, they are included in the order they appear. When more than one JSP property group
applies to a JSP page, the corresponding elements will be processed in the same order as they
appear in the JSP configuration section.
For example, the Duke's Bookstore application uses the files /template/prelude.jspf and
/template/coda.jspf
to include the banner and other boilerplate in each screen. To add these
files to the Duke's Bookstore property group using the deployment descriptor, follow these
steps:
1. In NetBeans IDE, expand your project's folder in the Projects pane.
2. Expand the Web Pages node and then the WEB-INF node.
3. Double-click web.xml to open it in the editor pane.
4. Click Pages at the top of the editor pane.
Setting Properties for Groups of JSP Pages
Chapter 5 · JavaServer Pages Technology
181