20.5. Including Files and Applets in JSP Documents

JSP has three main capabilities for including external pieces into a JSP document.

  1. The include directive. The construct lets you insert JSP code into the main page before that main page is translated into a servlet. The included code can contain JSP constructs such as field definitions and content-type settings that affect the main page as a whole. This capability is discussed in the first following subsection.

  2. The jsp:include action. Although reusing chunks of JSP code is a powerful capability, most times you would rather sacrifice a small amount of power for the convenience of being able to change the included documents without updating the main JSP page. The jsp:include action lets you include ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.