JSP Tutorials - Herong's Tutorial Examples - v5.11, by Herong Yang
Writing Directive Element in XML Format
This section describes the syntax of writing Directive Elements in XML format for a JSP document. There are 3 types of Directive Elements: page, include and taglib.
Writing Directive Elements in XML format for a JSP Document is really easy. See syntax below:
<jsp:directive.directive_name attribute=value .../>
JSP support 3 directive elements: page, taglib and include.
The most commonly used directive is probably the "page" directive, which specifies page level properties for the JSP container. Here is some examples:
<jsp:directive.page session="true"/> <jsp:directive.page import="java.util.*"/> <jsp:directive.page import="java.net.*" session="false"/> <jsp:directive.page contentType="text/html"/> <jsp:directive.page trimDirectiveWhitespaces="true"/>
Note that:
Another commonly used directive is the "include" directive, which tells the JSP server to include the specified JSP page into the current JSP page before converted to a Servlet class: Examples are:
<jsp:directive.include file="header.jsp"/> <jsp:directive.include file="footer.jsp"/>
More details for "taglib" directive elements are provided later in the book.
Table of Contents
JSP (JavaServer Pages) Overview
Tomcat Installation on Windows Systems
►Syntax of JSP Pages and JSP Documents
Syntactic Elements of a JSP Page
JSP Document - JSP Page in XML Format
JSP Document - JSP Version Error
Writing Scriptlet Element in XML Format
►Writing Directive Element in XML Format
Writing Action Element in XML Format
"include" Directive and Action Elements
Execution Result of CurrentTime.jspx
JavaBean Objects and "useBean" Action Elements
Managing HTTP Response Header Lines
Non-ASCII Characters Support in JSP Pages
Overview of JSTL (JSP Standard Tag Libraries)
Multiple Tags Working Together
Using Tomcat on CentOS Systems
Connecting to SQL Server from Servlet