[Top] [Prev] [Next] [Bottom]


Includes either a static or dynamic file in a JSP file.

JSP Syntax

<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.


See Also

[Top] [Prev] [Next] [Bottom]

Copyright © 1999, Sun Microsystems, Inc. All rights reserved.