This tutorial sample illustrates JSP 1.2 XML syntax (called
JSP XML Documents) along with suitable examples. All the JSP pages in this tutorial
sample are written using the XML Syntax.
Remarks
Traditional JSP constructs, such as <%@ page...> directives,
<%@ include... > directives, <%...%> for scriptlets, <%!...%>
for declarations, and <%=...%> for expressions, are not syntactically
valid within an XML document. The JavaServer Pages Specification, Version 1.2
offers more complete support for XML-compatible JSP syntax, adding features
and requiring support by compliant JSP containers. In addition, under the JSP
1.1 specification, one could intermix traditional syntax and XML-alternative
syntax within a page. This is not true in a JSP 1.2 environment.
The term JSP XML document (called JSP document in the JSP
1.2 specification) refers to a JSP page that uses this XML-compatible syntax.
The syntax includes, among other things, a root element and elements that serve
as alternatives to JSP directives, declarations, expressions, and scriptlets.
A JSP XML document is well formed in pure XML syntax, and is namespace-aware.
It uses XML namespaces to specify the JSP XML core syntax and the syntax of
any custom tag libraries used. A traditional JSP page, by contrast, is typically
not an XML document.