cdk
Tag body
Template body marker tag. Should be used only once in template document. Component renderers in JSF define three methods for content rendering, so the following rules are applied for <cc:implementation>
part of template document:
- all content declared before
<cdk:body>
tag is compiled into statements of encodeBegin(...)
method - all content declared inside
<cdk:body>
tag is compiled into statements of encodeChildren(...)
method. If content of body element is empty, no encodeChildren(...) method will be generated unless 'enforce' attribute set to true. - all content declared after
<cdk:body>
tag is compiled into statements of encodeEnd(...)
method
If there are no compiled statements for one of the aforementioned methods, then definition for this method is not created in the generated file.
If template document doesn't declare <cdk:body>
tag, then contents of <cc:implementation>
part is compiled into statements of encodeEnd(...)
method. Examples:
The following code snippet:
... <cc:implementation> <div id="myId"> <cdk:body> <span>Component content</span> </cdk:body> </div> </cc:implementation> ...
produces the following code (unsignificant details are ommitted): ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeChildren(...) { ... writer.startElement("span", cc); writer.writeText("Component content", null); writer.endlement("span"); } encodeEnd(...) { ... writer.endElement("div"); } ...
The following code snippet: ... <cc:implementation> <div id="myId"> <cdk:body /> </div> </cc:implementation> ...
produces the following code (unsignificant details are ommitted): ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeEnd(...) { ... writer.endElement("div"); } ...
If you want to disable default encodeChildren method, use enforce attribute: ... <cc:implementation> <div id="myId"> <cdk:body enforce="true"/> </div> </cc:implementation> ...
produces the following code (unsignificant details are ommitted): ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeChildren(...) { // empty method. } encodeEnd(...) { ... writer.endElement("div"); } ...
The following code snippet: ... <cc:implementation> <div id="myId"> Some text </div> </cc:implementation> ...
produces the following code (unsignificant details are ommitted): ... encodeEnd(...) { ... writer.startElement("div", cc); writer.writeText("Some text", null); writer.endElement("div"); } ...
Attributes |
Name | Required | Request-time | Type | Description |
enforce | false | true | boolean | No Description |
Output Generated by
Tag Library Documentation Generator.
Java, JSP, and JavaServer Pages are trademarks or
registered trademarks of Sun Microsystems, Inc. in the US and other
countries. Copyright 2002-4 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054, U.S.A.
All Rights Reserved.