O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required