Includes either a static or dynamic file in a JSP file.
<jsp:include page="
{ relativeURL| <%=
expression%>}" flush="true" />
<jsp:include page="scripts/login.jsp" /> <jsp:include page="copyright.html" /> <jsp:include page="/index.html" />
The <jsp:include>
tag allows you to include either a static or dynamic file. A static file is parsed and its content included in the calling JSP page. A dynamic file acts on the request and sends back a result that is included in the JSP page.
You cannot always determine from a pathname if a file is static or dynamic. For example, a pathname like http://server:8080/index.html might map to a dynamic servlet by using a Web server alias. The <jsp:include>
tag handles both types of files, so it is convenient to use when you don't know whether the file is static or dynamic.
When the include action is finished, the JSP engine continues processing the remainder of the JSP file.
page="{
relativeURL | <%=
expression %>}"
The relative URL to the file to be included, or an expression that evaluates to a String
equivalent to the relative URL.
The relative URL looks like a pathname-it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP file. If it is absolute (beginning with a /), the pathname is resolved by your Web or application server.
flush="true"
In JSP 1.0, you must include flush="true"
, as it is not a default value.