Name

<jsp:root>

Synopsis

The <jsp:root> action element can only be used as the root element in a JSP Document (a JSP page in XML syntax). In specification versions prior JSP 2.0, using a <jsp:root> element was the only way to identify a JSP page as a JSP Document, but there are now other means (see Chapter 16) to do so. Hence, the <jsp:root> element is optional and should rarely be used.

Syntax

<jsp:root version="jspVersion">
  Well-formed XML content
</jsp:root>

Attributes

Attribute name

Java type

Dynamic value accepted

Description

version
String

No

The JSP specification with which the JSP Document is compliant.

Example

                     <jsp:root version="2.0">
  <employee>
    <name>${param.empName}</name>
    <dept>${param.empDept}</dept>
  <employee>
</jsp:root>

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.