Custom JSP taglib. These tags provide functionality to the internationalization your web applications. The term i18n comes from the simple fact that the word "internationalization" starts with the letter I, ends with the letter N and has 18 letters. For example:
<%@ taglib uri="taglib.tld" prefix="i18n" %> <i18n:setBundle baseName="constants" id="A" /> <i18n:getMessage id="A" key="User"/> <i18n:getMessage id="A" key="Name"> key Name is not defined </i18n:getMessage> in this example bundle points to files in CLASSPATH (e.g. in WEB-INF/classes) with names like constants_en.properties, constants_en_US.properties, constants_fr.properties etc. Tags are: setBundle Tag loads the bundle for the provided baseName. Tag may use locale from browser preferences or directly defined by parameter. Parameters are: 1) baseName Optional parameter. Describes a base name for properties files. Default
value is ApplicationResources.
getMessage Body tag. This tag looks up a key in the localize bundle and prints the value. Body will be executed if key is not defined. Parameters are: 1) key key for lookup
ifdef Body tag. Body will be executed if key is defined in the given bundle. Parameters are: 1) key key for lookup
ifndef Body tag. Body will be executed if key is not defined in the given bundle. Parameters are: 1) key key for lookup
for downloading: Library: i18ntag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags. |
Also in Coldtags:
|