Favicon taglib ver. 1.2

    Custom JSP taglib. Lets you work with favicons in your web applications. Tag addFavicon lets you add favicon from the remote sites to your JSP pages. For example:
 


<%@ taglib uri="taglib.tld" prefix="i" %>
<br/><i:addFavicon>http://www.google.com</i:addFavicon> http://www.google.com
<br/><i:addFavicon>http://www.servletsuite.com/jsp.htm</i:addFavicon> http://www.servletsuite.com/jsp.htm

and you will get some like this:


icon http://www.google.com
icon http://www.servletsuite.com/jsp.htm

You can provide an alternate image (in case of favicon.ico does not exist of the requested site). Also you can provide your own CSS settings for the image. By default tag will use the following: width=16 height=16 border=0

Tag insertFavicon lets you embed JavaScript code for adding favicon from the remote sites. So in this case favicon will be actually added on the client side.

Tag blinkFavicon lets you embed JavaScript code for simulating blinking favicon on your own site. You can use a blinking favicon as a notification for various events (messages, buddy login, signout). For example:
 


<%@ taglib uri="taglib.tld" prefix="i" %>
<br/><i:blinkFavicon/>

and you will see favicon blinking.

Tags are:

addFavicon

Body tag lets you add favicon file from the remote host. Tag's body describes an URL for the host. Attributes are:

1) className Optional parameter. Defines a CSS class for the image
2) style Optional parameter. Defines a CSS style
3) alternate Optional parameter. Defines an URI for alternate image
4) cond Optional parameter. Defines a boolean value tag's behavior depends on. Default value is true (add favicon).

insertFavicon

Body tag lets you create JavaScript code for adding favicon file from the remote host. Tag's body describes an URL for the host. Attributes are:

1) className Optional parameter. Defines a CSS class for the image
2) alternate Optional parameter. Defines an URI for alternate image
3) cond Optional parameter. Defines a boolean value tag's behavior depends on. Default value is true (insert code for favicon).

blinkFavicon

Body tag lets you create JavaScript code for blinking favicon on your host. Attributes are:

1) delay Optional parameter. Defines a delay for blinking in milliseconds. Default value is 500.
2) alternate Optional parameter. Defines an URI for alternate image
3) cond Optional parameter. Defines a boolean value tag's behavior depends on. Default value is true (blink).

for downloading:

Library: favicontag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: