<tsx:getProperty>
The <tsx:getProperty> tag gets the value of a bean to display in a JavaServer Pages (JSP) file.
The <tsx:getProperty> is an IBM extension of the Sun Microsystems <jsp:getProperty> tag. The IBM extension implements all of the <jsp:getProperty> function and adds the ability to introspect a database bean that was created using the IBM extension <tsx:dbquery> or <tsx:dbmodify> tag.
The <tsx:getProperty> uses the query results object (for the <tsx:dbquery> syntax whose identifier is specified by the <tsx:getProperty> bean attribute) and the appropriate column name (specified by the <tsx:getProperty> property attribute) to retrieve the value.
Note: You cannot assign the value from the <tsx:getProperty> tag to a variable. The value, generated as output from this tag, is displayed in the browser window.
The <tsx:getProperty> syntax is:
<tsx:getProperty name="bean_name" property="property_name" />The following list describes the attributes and their values:
name
The name of the bean declared by the id attribute of a <tsx:dbquery> syntax within the JSP file. See <tsx:dbquery> for more information. The value of this attribute is case-sensitive.property
The property of the bean to access for substitution. The value of the attribute is case-sensitive and is the locale-independent name of the property.
>Examples
<tsx:getProperty name="userProfile" property="username" /> <tsx:getProperty name="request" property=request.getParameter("corporation") />In most cases, the value of the property attribute will be just the property name. However, to access the request bean or access a property of a property (subproperty), you specify the full form of the property attribute. The full form also gives you the option to specify an index for indexed properties. The optional index can be a constant (such as 2) or an index like the one described in <tsx:repeat>.
Some examples of using the full form of the property attribute:
<tsx:getProperty name="staffQuery" property=address(currentAddressIndex) /> <tsx:getProperty name="shoppingCart" property=items(4).price /> <tsx:getProperty name="fooBean" property=foo(2).bat(3).boo.far />