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.

The page and include directives are described later, and the taglib directive is described tomorrow (Day 14) when Tag Libraries are studied in details.

The include Directive

You use the include directive to insert the contents of another file into the JSP. 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 small pieces of HTML to create common look and feel.

If the include file is itself a JSP, it ...

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