Gets the value of a Bean property so that you can display it in a result page. Taglib mimics
jsp:getProperty and adds a list of useful features. You can control the output if your bean or property
does not exist, tag works with HasMap (Hashtable) as well as with indexed properties. For example:
<%@ taglib uri="taglib.tld" prefix="g" %> <jsp:useBean id="calendar" scope="page" class="employee.Calendar" /> Calendar of <g:getProperty name="calendar" property="username" /> The getProperty element gets a Bean property value using the property's getter methods and displays the property value in a JSP page (saves in the page scope variable). If your bean is HashMap (Hashtable) tag threats property as a key and uses get method. Tag prints nothing if bean (property) does not exist or the calculated value is null. Actually this tag is a body tag. You you can define how your outputs will looks like:
<g:getProperty name="calendar" property="username"> value="<%=propertyValue%>" </g:getProperty> here propertyValue is a predefined nested page scope variable with the calculated value. Tags are: getProperty Body tag getProperty gets a Bean property value using the property's getter methods. Parameters are: 1) name The name of an object (usually an instance of a Bean)
for downloading: Library: getproptag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|