<jsp:root>
Defines standard JSP elements and namespace attributes of tag libraries.
JSP Syntax
None. However, see Taglib Directive.
XML Syntax
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" [ xmlns:taglibPrefix="URI" ]+ ... version="1.2 | 2.0"> JSP Page </jsp:root>
Example
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:public="http://www.jspcentral.com/tags" version="2.0"> <public:loop> ... </public:loop> </jsp:root>
Description
A JSP page in XML syntax can have jsp:root as its root element, but it is not required. You can instead specify your own tag as a root element. Tag libraries used within the JSP page can be represented in the root element through xmlns attributes. (Again, you can use the xmlns attributes in other tags besides the jsp:root element. The xmlns:jsp and version attributes are mandatory.
Attributes
xmlns:jsp="http://java.sun.com/JSP/Page"version="1.2 | 2.0"xmlns:taglibPrefix="URI"- Specifies a tag library prefix and URI.
- taglibPrefix precedes the custom tag name, for example,
publicin<public:loop>. Empty prefixes are illegal. If you are developing or using custom tags, you cannot use the tag prefixesjsp,jspx,java,javax,servlet,sun, andsunw, as they are reserved by Sun Microsystems.- URI uniquely locates the TLD that describes the set of custom tags associated with the named prefix. URI may be of one of two forms:
- taglibPrefix precedes the custom tag name, for example,
- A URI:
- A Uniform Resource Locator (URL), as defined in RFC 2396, available at http://www.rfc-editor.org/rfc/rfc2396.txt
- A Uniform Resource Name (URN), as defined in RFC 2396
urn:jsptld:path.
- If the URI is a URI, then the TLD is located by consulting the mapping indicated in
web.xmlextended using the implicit maps in the packaged tag libraries. If URI is of the formurn:jsptld:path, path is interpreted relative to the root of the web application and should resolve to a TLD file directly, or to a JAR file that has a TLD file at locationMETA-INF/taglib.tld.
- Specifies a tag library prefix and URI.
