HTML and CSS Reference
In-Depth Information
<attribute>
<name>textType</name>
<type>java.lang.String</type>
<description>Type of random text to generate. Either gibberish or lorem</description>
<required>true</required>
</attribute>
<attribute>
<name>outputTag</name>
<type>java.lang.String</type>
<description>Type of HTML to generate. Either p for paras or ul for list.</description>
</attribute>
<attribute>
<name>count</name>
<type>java.lang.Integer</type>
<description>Number of paragraphs or items to return</description>
<required>true</required>
</attribute>
<attribute>
<name>minWords</name>
<type>java.lang.Integer</type>
<description>Minimum number of words to return in each para or item.</description>
</attribute>
<attribute>
<name>maxWords</name>
<type>java.lang.Integer</type>
<description>Maximum number of words to return in each para or item.</description>
</attribute>
</tag>
</facelet-taglib>
Place the randomtext.taglib.xml file in the /WEB-INF directory. Placing the file in this directory does not make it
automatically discoverable by the JSF implementation. We must first tell the JSF implementation to look at the taglib
file through the javax.faces.FACELETS_LIBRARIES context parameter in web.xml; see Listing 6-9.
Listing 6-9. /WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns=" http://xmlns.jcp.org/xml/ns/javaee "
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation=" http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd ">
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/randomtext.taglib.xml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>faces/example.xhtml</welcome-file>
</welcome-file-list>
</web-app>
Search WWH ::




Custom Search