JSP Directives

Directives are used to define information about your page to the translator; they do not produce any HTML output. All directives have the following syntax:

<%@ directive [ attr="value" ] %>

where directive can be page, include, or taglib. Typically JSP directives are included before the HTML <HEAD> tag of your JSP.

The page and include directives are described here, and the taglib directive is described tomorrow when Tag Libraries are studied in detail.

The include Directive

You use the include directive to insert the contents of another file into the Web page as the page is translated. The included file can contain HTML or JSP tags or both. It is a useful mechanism for including the same page directives in all your JSPs or reusing ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition 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.