53 lines
3.1 KiB
HTML
53 lines
3.1 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
||
|
|
||
|
<title><tsx:getProperty></title>
|
||
|
</head>
|
||
|
|
||
|
<BODY>
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
<h5><a name="jspget"></a><tsx:getProperty></h5>
|
||
|
|
||
|
<p>The <tsx:getProperty> tag gets the value of a bean to display in a JavaServer Pages (JSP) file.</p>
|
||
|
|
||
|
<p>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.</p>
|
||
|
|
||
|
<p>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.</p>
|
||
|
|
||
|
<p><strong>Note:</strong> 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.</p>
|
||
|
|
||
|
<p>The <tsx:getProperty> syntax is:</p>
|
||
|
|
||
|
<pre><tsx:getProperty name="<em>bean_name</em>" property="<em>property_name</em>" /></pre>
|
||
|
|
||
|
<p>This list describes the attributes and their values:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li><p><strong>name</strong>
|
||
|
<br>The name of the bean declared by the <tt>id</tt> attribute of a <tsx:dbquery> syntax within the JSP file. See <a href="jspqry.htm"><tsx:dbquery></a> for more information. The value of this attribute is case-sensitive.</p></li>
|
||
|
|
||
|
<li><p><strong>property</strong>
|
||
|
<br>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.</p></li>
|
||
|
</ul>
|
||
|
|
||
|
<p><strong>>Examples</strong></p>
|
||
|
|
||
|
<pre><tsx:getProperty name="userProfile" property="username" />
|
||
|
<tsx:getProperty name="request" property=request.getParameter("corporation") /></pre>
|
||
|
|
||
|
<p>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 <a href="jsprpt.htm"><tsx:repeat></a>.</p>
|
||
|
|
||
|
<p>Some examples of using the full form of the property attribute:</p>
|
||
|
|
||
|
<pre><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 /></pre>
|
||
|
|
||
|
</body>
|
||
|
</html>
|