The Components of a JavaServer Page

In this section we are going to cover the components that make up a JavaServer Page. They are discussed in detail in the following sections.

Directives

Directives are JSP elements that provide global information about an entire JSP page. An example would be a directive that indicated the language to be used in compiling a JSP page. The syntax of a directive is as follows:

<%@ directive {attribute="value"} %>

This states that, for this page directive, assign these values for these attributes. A directive can contain n number of optional attribute/value pairs.

If we use our previous example for indicating the JSP language, the following line of code would indicate that the JSP language to use would be Java: ...

Get Pure Java Server Pages™ 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.