Page Directive

The page directive defines page-dependent attributes, such as scripting language, error page, and buffering requirements. It supports the attributes described in Table 1-2.

Table 1-2. Attributes for the page directive

Name

Default

Description

autoFlush

true

Set to true if the page buffer should be flushed automatically when it’s full or to false if an exception should be thrown when it’s full.

buffer

8kb

Specifies the buffer size for the page. The value must be expressed as the size in kilobytes followed by kb, or be the keyword none to disable buffering.

contentType

text/html

The MIME type for the response generated by the page, and optionally the charset for the source page (e.g., text/html;charset=Shift_JIS).

errorPage

No default

A page- or context-relative URI path to which the JSP page will forward users if an exception is thrown by code in the page.

extends

No default

The fully qualified name of a Java class that the generated JSP page implementation class extends. The class must implement the JspPage or HttpJspPage interface in the javax.servlet.jsp package.

Note that the recommendation is to not use this attribute. Specifying your own superclass restricts the web container’s ability to provide a specialized, high-performance superclass.

import

No default

A Java import declaration; i.e., a comma-separated list of fully qualified class names or package names followed by .* (for all public classes in the package). ...

Get JavaServer Pages Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.