Custom JSP taglib. This taglib lets you build web controls from properties files.
Tag listProperties reads properties file and displays all the elements as a dropdown list
(group of checkboxes or radio buttons). For example, suppose you have the following data in your test.ini file:
key1=option 1 key2=option 2 etc. then the following code displays a drop down list for available options:
<%@ taglib uri="taglib.tld" prefix="ini" %> <ini:listPropeties name="list" file="test.ini" control="dropdown"/> and you will get some like this: Body tag setSelected lets you define a selected option. Tag's body describes a key for selected element. E.g.:
<ini:listPropeties name="list" file="test.ini" control="dropdown"> <ini:setSelected>key2</ini:setSelected> </ini:listProperties> You can use check boxes (or radio buttons) instead of the drop down list. For example:
<ini:listPropeties name="list" file="test.ini" control="radio"> <ini:setSelected>key2</ini:setSelected> </ini:listProperties> and you will get some like this: You can read localized values also. In this case you have to provide a base name for your properties files.
For example:
<ini:listPropeties name="list" baseName="test" control="dropdown"/> in this example tag points to files in CLASSPATH (e.g. in WEB-INF/classes) with names like test_en.properties, test_en_US.properties, test_fr.properties etc. depends on the locale. Tags are: listProperties Displays HTML control from the given properties file. Parameters are: 1) name Describes a name for your control
setSelected Body tag describes a key for the selected (checked) element. Parameters are: none for downloading: Library: listprop.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|