HTML and CSS Reference
In-Depth Information
Table 6-3. Tag Details in a TLD
Elements
Description
<tag>
Outer element enclosing a single tag
<tag-name />
Name of the tag
<component>
Outer element enclosing details about the component embodied in the tag
<component-type />
Component type embodied in the tag. Must match the component type set on the
implementation of the UIComponent
<renderer-type />
Renderer type to use for rendering the tag. Must match the renderer type set on the
implementation of the renderer
</component>
<attribute>
Outer element enclosing details about a single attribute on the tag. This section should
be repeated for all the attributes that should be exposed to the JSF Framework and the
page author
<name />
Name of the attribute
<type />
Type of attribute (e.g. java.lang.String)
<method-signature / >
Method signature if the input is a method instead of a type
<description />
Description of the attribute. This will appear in the code help for the page author
<required / >
Boolean value determining if the attribute is required
<display-name / >
User-friendly name for the attribute, used by IDEs
<icon / >
Graphical representation of the attribute, used by IDEs
</attribute>
</tag>
The complete TLD file can be seen in Listing 6-8.
Listing 6-8. /WEB-INF/randomtext.taglib.xml
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
xmlns=" http://java.sun.com/xml/ns/javaee "
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-
facelettaglibrary_2_0.xsd "
version="2.0">
<namespace> http://com.apress.projsf2html5/randomtext</namespace >
<tag>
<tag-name>randomtext</tag-name>
<component>
<component-type>RandomText</component-type>
<renderer-type>com.apress.projsf2html5.components.RandomTextRenderer</renderer-type>
</component>
 
Search WWH ::




Custom Search