From Hall Core book:

You use the include directive to include a file in the main JSP document at the time the document is translated into a servlet (which is typically the first time it is accessed). The syntax is as follows:

<%@ include file="Relative URL" %>

There are two ramifications of the fact that the included file is inserted at page translation time, not at request time as with jsp:include (Section 12.2).

First, you include the actual file itself, unlike with jsp:include , where the server runs the page and inserts its output. This approach means that the included file can contain JSP constructs (such as field or method declarations) that affect the main page as a whole.

Second, if the included file changes, all the JSP files that use it need to be updated. Unfortunately, although servers are allowed to support a mechanism for detecting when an included file has changed (and then recompiling the servlet), they are not required to do so. In practice, few servers support this capability. Furthermore, there is not a simple and portable “retranslate this JSP page now” command. Instead, you have to update the modification date of the JSP page. Some operating systems have commands that update the modification date without your actually editing the file (e.g., the Unix touch command), but a simple portable alternative is to include a JSP comment in the top-level page. Update the comment whenever the included file changes. For example, you might put the modification date of the included file in the comment, as below.

<%-- Navbar.jsp modified 3/1/00 --%>
<%@ include file="Navbar.jsp" %>