The include Directive

As we discussed in Chapter 1, "JSP Overview: The Components of a Java Server Page," the JSP include directive is used to insert text and code into a JSP at translation time. After the initial request is processed, the data included does not change until the included file is changed and the server is restarted. The syntax of the include directive is

<%@ include file="relativeURLspec" %>

The file that the file attribute points to can reference a normal text HTML file or a JSP file, which will be evaluated at translation time.

Note

Currently the JSP 1.1 specification does not have a defined method for notifying the JSP engine that the included file has changed.

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.