It is normal to add all the include files to the WEB-INF folder.
Some would also like the include files should have the extension .jspf, but this is not a requirement.

Here is the file we want to include at the top of all pages:

<h1>The Company</h1><hr>

For those who participate in the review:
create a JSP file in Netbeans
and replace generated code for the JSP with that shown above (the JSP file name is Header.jsp and folder should be WEB-INF).

Here is the file we want to include at the bottom of all pages:

<hr>
Today is: <%= java.util.Calendar.getInstance().getTime() %>

For those who participate in the review:
create a JSP file in Netbeans
and replace generated code for the JSP with that shown above (the JSP file name is Footer.jsp and folder should be WEB-INF).

Then we need a JSP file to demonstrate how we use the include directives.

Here is the main JSP file:

<%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>JSP Page</title></head><body style="max-width:600px; text-align: center; "><%@ include file="/WEB-INF/header.jsp"%><h2>Presentation</h2><p>
We created our product because we knew there had to
be a better way to build java applications.
We’re developers, so we know what developers want:
a modern programming language, powerful tools,
an efficient and delightful workflow and the
power to create the best user experiences.
We are on a mission to make it fast, easy and
fun to build great mjava applications.
</p><jsp:directive.include file="/WEB-INF/footer.jsp" /></body></html>

For those who participate in the review:
create a JSP file in Netbeans
and replace generated code for the JSP with that shown above (the JSP file name is Presentation.jsp ).

How does this work?

We have created two JSP files, Header.jsp and Footer,jsp, which we want to include in other JSP documents.

With the include directive we includes these files where we want the contents of the files must be included in JSP file, Presentation.jsp.

Creating Deployment descriptor.

To run this JSP you have to deploy it to a web-server or a Application
server. To deploy means to install the JSP with some instruction
to a such server.

The instructions are mainly defined to be deployment descriptors.
The standard part of the deployment descriptor should be in an
XML-file with the name web.xml.

You may need to create a Deployment descriptor file,
web.xml in Netbeans.

This file starts with the normal xml tag for a XML file and
the root tag for the deployment descriptor is web-app. Every ting
inside the last tag is to tell the server about our application,
which in this case is a JSP file.

With a servlet tag we give the JSP file a servlet name,
which is used in the servlet-mapping tag to specify a url
for the JSP file.

In this way we can have many urls for the same JSP file.

If no session-timeout (the server ends the service
of the application after this time) is given a standard timeout for the server is used
as timeout for the application.

The welcome-file tag specifies the startup for our application,
which in this case and our application is the url Presentation.
Reorganize the welcome-file-list to what is shown above.

Creating Web-server Deployment descriptor.

The context-root (in example /IncludeDirective) for the application
will in most cases be specified by a server vendor deployment descriptor.