directive, you can direct the servlet to import classes, define a general error reporting page, or set a content type. The pagedirective follows the general form shown below: <%@ page attributelist %> You can code one or more page directives in your JSP page. However, with one exception, take care to ensure that you code only one name-value pair per page. The exception is that you may code more than one import attribute, the use of which is explained shortly. You may code page directives anywhere in your JSP page. By convention, page directives are coded at the top of the JSP page. JSP also permits a coding style that follows XML syntax rules. The following is an example of a page directive coded with the XML style: The preceding page directive is the same as the example shown here: <%@ page buffer="8k" %> Table 4-1 lists the allowable list of attributes with a short description of each. Table 4-1: Allowable Page Directive Attributes Page Directive Attributes Short Description buffer Specifies a buffering model for the output stream autoFlush Controls the behavior of the servlet output buffer contentType Defines the character encoding scheme errorPage Defines the URL of another JSP that reports on Java unchecked runtime exceptions isErrorPage Indicates if this JSP page is a URL specified by another JSP page’s errorPageattribute extends Specifies a superclass that the generated servlet must extend import Specifies a list of packages or classes for use in the JSP as the Java importstatement does for Java classes info Defines a string that can be accessed with the servlet s getServletInfo()method isThreadSafe Defines the threading model for the generated servlet language Defines the programming language used in the JSP page. session Specifies whether or not the JSP page participates in HTTP sessions Now let s explore the attributes listed in Table 4-1 in more detail.
Interland Web Hosting is the leader in the industry of discount and affordable web hosting. All plans are feature packed, with 24×7 tech support, automatic backups. You also get visitor statistics, spam filtering, email anti virus, and much more. Web page hosting is generally sufficient only for personal home pages.

Leave a Reply