Custom JSP taglib lets you display Web 2.0 cloud. Cloud here is a set of hyperlinks where
font size depends on the element's weight. For example:
<%@ taglib uri="taglib.tld" prefix="c" %> <style type="text/css"> .link { color: #333399; text-decoration: none; font-family: Geneva, Arial, Helvetica, sans-serif; } a.link a.link:visited { color: #333399; text-decoration: none; font-family: Geneva, Arial, Helvetica, sans-serif; } a.link:hover { color: #FF8C00; text-decoration: none; font-family: Geneva, Arial, Helvetica, sans-serif; } </style> Tags are: <div style="position:relative;left:200px;width:300px"> <c:cloud className="link"> <c:element url="http://www.servletsuite.com" weight="2">Coldbeans</c:element> <c:element url="http://www.servletsuite.com/jsp.htm" weight="6">Coldtags suite</c:element> <c:element url="http://www.servletsuite.com/servlets.htm" weight="3">JSOS</c:element> <c:element url="http://www.servletsuite.com/servlets/caltag.htm" weight="1">Calendar</c:element> <c:element url="http://www.servletsuite.com/jmx" weight="4">JMX</c:element> </c:cloud> </div> and you will get some like this:
Your cloud contains a set of hyperlinks. And size for the element depends on its weight.
You can directly provide a set of elements (see example above) or prepare that set on your server
side and pass to the tag a collection of elements. Your collection can keep elements of
com.cj.cloud.ElementBean type. This bean has got the following properties (as well as the appropriate get/set methods):
String url; String text; String target; String onClick; String title; String className; int weight; There are two ways for passing the collection. Attribute value lets you directly provide collection, iterator, enumeration or array with elements. Attribute name lets you provide a name for your collection (iterator, enumeration etc.) in the request (page, session, application) scope. Tags are: cloud Body tag lets you display Web 2.0 cloud. Parameters are: 1) value Optional parameter. Describes collection, iterator, enumeration or array
with elements.
element Body tag describes an individual element. Parameters are: 1) url Optional parameter. Describes an url for this hyperlink
for downloading: Library: cloudtag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags. |
Also in Coldtags:
|