The jsp:include Action
This action insert files into the page being generated. The syntax
looks like this:
<jsp:include page="relative URL" flush="true" />
Unlike the include directive,
which inserts the file at the time the JSP page is
translated into a servlet, this action inserts the file at the time the page
is requested. This is dynamic.
in the test.jsp
<jsp:include page="header.jsp" flush="true"/>
every time header.jsp is executed and the content is pasted to test.jsp - In case of jsp:include
or
<jsp:include page="header.jsp">
<jsp:param name="title" value="First Page"/>
</jsp:include>
You can pass the param value to included jsp also.
In the header.jsp you can get the value by
String title = request.getParameter("title");