📄 syntaxref.fm10.html
字号:
<html><head><title></title></head><body bgcolor=#ffffff> <a href="tags.html">[Top]</a> <a href="syntaxref.fm9.html">[Prev]</a> <a href="syntaxref.fm11.html">[Next]</a> <a href="Copyright.fm.html">[Bottom]</a><hr><br> <a name="8820"> </a><h2 align="center"> <jsp:getProperty></h2><p><a name="9771"> </a>Gets the value of a Bean property so that you can display it in a result page.</p><a name="9190"> </a><h4> JSP Syntax</h4><blockquote><pre><code><jsp:getProperty name="</code><em>beanInstanceName</em><code>"  property="</code><em>propertyName</em><code>" /></code></pre></blockquote><a name="9194"> </a><h4> Examples</h4><blockquote><pre><jsp:useBean id="calendar" scope="page" class="employee.Calendar" /><h2>Calendar of <strong><jsp:getProperty name="calendar" property="username" /></strong> </h2></pre></blockquote><a name="9198"> </a><h4> Description</h4><p><a name="9199"> </a>You must create or locate a Bean instance with <code><jsp:useBean></code> <em>before</em> you use <code><jsp:getProperty></code>.</p><p><a name="16064"> </a>The <code><jsp:getProperty></code> tag gets a Bean property value using the property's <code>get</code> method, converts the value of a Bean property to a <code>String</code> and stores it in the <code>out</code> object. </p><p><a name="17115"> </a>In JSP 1.0, <code><jsp:getProperty></code> has a few limitations you should be aware of:</p><ul><a name="17116"> </a><li>You cannot use <code><jsp:getProperty></code> to retrieve the values of an indexed property.<a name="16053"> </a><li>You can use <code><jsp:getProperty></code> with JavaBeans components, but not with enterprise beans. You can get around this limitation by writing a JSP application in which a JSP file gets values from a Bean, and the Bean in turns calls an enterprise bean.</ul><a name="15747"> </a><h4> Attributes</h4><ul><a name="15748"> </a><li><code>name="</code><em>beanInstanceName</em><code>"</code><p><a name="15749"> </a>The name of the Bean instance as declared in a <code><jsp:useBean></code> tag.</p><a name="10919"> </a><li><code>property="</code><em>propertyName</em><code>"</code><p><a name="10920"> </a>The name of the Bean property whose value you want to display.</p></ul><a name="9201"> </a><h4> See Also</h4><ul><a name="9202"> </a><li><code><a href="syntaxref.fm14.html#8865"><jsp:useBean></a></code><a name="9203"> </a><li><code><a href="syntaxref.fm13.html#8856"><jsp:setProperty></a></code></ul><hr><br> <a href="tags.html">[Top]</a> <a href="syntaxref.fm9.html">[Prev]</a> <a href="syntaxref.fm11.html">[Next]</a> <a href="Copright.fm.html">[Bottom]</a><hr><br><i>Copyright © 1999, Sun Microsystems, Inc. All rightsreserved.</i></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -