Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
270
Chapter 12 Including Files and Applets in JSP Documents
Figure 12 1 Result of SomeRandomPage.jsp.
12.2 Including Files at Request
Time
The
include
directive (Section 12.1) lets you include documents that con
tain JSP code into multiple different pages. Including JSP content is a useful
capability, but the
include
directive requires you to update the modification
date of the page whenever the included file changes, which is a significant
inconvenience. The
jsp:include
action includes files at the time of the cli
ent request and thus does not require you to update the main file when an
included file changes. On the other hand, the page has already been trans
lated into a servlet by request time, so the included files cannot contain JSP.
Core Approach
Use the
include
directive if included files will use JSP constructs.
Otherwise, use
jsp:include
.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved