Contents | Prev | Next


<jsp:body>

Specifies the body of a tag.

JSP Syntax

<jsp:body>any elements or text</jsp:body>

XML Syntax

Same as JSP syntax.

Examples

This example generates an HTML header tag with a lang attribute:

<jsp:element name="${content.headerName}"	
   xmlns:jsp="http://java.sun.com/JSP/Page">	
   <jsp:attribute name="lang">${content.lang}</jsp:attribute>	
   <jsp:body>${content.body}</jsp:body>	
</jsp:element>

The name attribute identifies the generated tag's name. The jsp:attribute tag generates the lang attribute. The body of the jsp:attribute tag identifies the value of the lang attribute. The jsp:body tag generates the body of the tag. The output of this example jsp:element could be:

<h1 lang="fr">Heading in French</h1>

Description

Normally, the body of a standard or custom action invocation is defined implicitly as the body of the XML element used to represent the invocation. The body of a standard or custom action can also be defined explicitly using the jsp:body standard action. This is required if one or more jsp:attribute elements appear in the body of the tag.

If one or more jsp:attribute elements appear in the body of a tag invocation but no jsp:body element appears or an empty jsp:body element appears, it is the equivalent of the tag having an empty body.

It is also legal to use the jsp:body standard action to supply bodies to any standard actions that accepts a body (except for jsp:body, jsp:attribute, jsp:scriptlet, jsp:expression, and jsp:declaration). The body standard action accepts no attributes.

See Also



Contents | Prev | Next

Copyright © 2004, Sun Microsystems, Inc. All rights reserved.