⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsptags5.html

📁 j2eePDF格式的电子书
💻 HTML
📖 第 1 页 / 共 4 页
字号:
(optional) A short name that is intended to be displayed by tools. Defaults to the name of the tag file without the extension <code class="cCode">.tag</code>.</div></td></tr>  <tr align="left">    <td><a name="wp89802"> </a><div class="pCellBody"><code class="cCode">body-content</code></div></td>    <td><a name="wp89804"> </a><div class="pCellBody">(optional) Provides information on the content of the body of the tag. Can be either <code class="cCode">empty</code>, <code class="cCode">tagdependent</code>, or <code class="cCode">scriptless</code>. A translation error will result if <code class="cCode">JSP</code> or any other value is used. Defaults to <code class="cCode">scriptless</code>. See <a  href="JSPTags5.html#wp89848">body-content Attribute&nbsp;</a>.</div></td></tr>  <tr align="left">    <td><a name="wp89809"> </a><div class="pCellBody"><code class="cCode">dynamic-attributes</code></div></td>    <td><a name="wp89811"> </a><div class="pCellBody">(optional) Indicates whether this tag supports additional attributes with dynamic names. The value identifies a scoped attribute in which to place a <code class="cCode">Map</code> containing the names and values of the dynamic attributes passed during invocation of the tag.</div><a name="wp89812"> </a><div class="pCellBody">&#160;</div><a name="wp89813"> </a><div class="pCellBody">A translation error results if the value of the <code class="cCode">dynamic-attributes</code> of a <code class="cCode">tag</code> directive is equal to the value of a <code class="cCode">name-given</code> of a <code class="cCode">variable</code> directive or the value of a <code class="cCode">name</code> attribute of an <code class="cCode">attribute</code> directive.</div></td></tr>  <tr align="left">    <td><a name="wp89815"> </a><div class="pCellBody"><code class="cCode">small-icon</code></div></td>    <td><a name="wp89817"> </a><div class="pCellBody">(optional) Relative path, from the tag source file, of an image file containing a small icon that can be used by tools. Defaults to no small icon.</div></td></tr>  <tr align="left">    <td><a name="wp89819"> </a><div class="pCellBody"><code class="cCode">large-icon</code></div></td>    <td><a name="wp89821"> </a><div class="pCellBody">(optional) Relative path, from the tag source file, of an image file containing a large icon that can be used by tools. Defaults to no large icon.</div></td></tr>  <tr align="left">    <td><a name="wp89823"> </a><div class="pCellBody"><code class="cCode">description</code></div></td>    <td><a name="wp89825"> </a><div class="pCellBody">(optional) Defines an arbitrary string that describes this tag. Defaults to no description.</div></td></tr>  <tr align="left">    <td><a name="wp89827"> </a><div class="pCellBody"><code class="cCode">example</code></div></td>    <td><a name="wp89829"> </a><div class="pCellBody">(optional) Defines an arbitrary string that presents an informal description of an example of a use of this action. Defaults to no example.</div></td></tr>  <tr align="left">    <td><a name="wp89831"> </a><div class="pCellBody"><code class="cCode">language</code></div></td>    <td><a name="wp89833"> </a><div class="pCellBody">(optional) Carries the same syntax and semantics of the <code class="cCode">language</code> attribute of the <code class="cCode">page</code> directive.</div></td></tr>  <tr align="left">    <td><a name="wp89835"> </a><div class="pCellBody"><code class="cCode">import</code></div></td>    <td><a name="wp89837"> </a><div class="pCellBody">(optional) Carries the same syntax and semantics of the <code class="cCode">import</code> attribute of the <code class="cCode">page</code> directive.</div></td></tr>  <tr align="left">    <td><a name="wp89839"> </a><div class="pCellBody"><code class="cCode">pageEncoding</code></div></td>    <td><a name="wp89841"> </a><div class="pCellBody">(optional) Carries the same syntax and semantics of the <code class="cCode">pageEncoding</code> attribute in the <code class="cCode">page</code> directive. </div></td></tr>  <tr align="left">    <td><a name="wp89843"> </a><div class="pCellBody"><code class="cCode">isELIgnored</code></div></td>    <td><a name="wp89845"> </a><div class="pCellBody">(optional) Carries the same syntax and semantics of the <code class="cCode">isELIgnored</code> attribute of the <code class="cCode">page</code> directive.</div></td></tr></table></div><p class="pBody"></p><a name="wp89848"> </a><h4 class="pHeading3">body-content Attribute</h4><a name="wp89850"> </a><p class="pBody">You specify the character of a tag's body content using the <code class="cCode">body-content</code> attribute:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative">bodycontent=&quot;empty | scriptless | tagdependent&quot;<a name="wp89851"> </a></pre></div><a name="wp89852"> </a><p class="pBody">You must declare the body content of tags that do not accept a body as <code class="cCode">empty</code>. For tags that have a body there are two options. Body content containing custom and standard tags and HTML text is specified as <code class="cCode">scriptless</code>. All other types of body content--for example, SQL statements passed to the query tag--is specified as <code class="cCode">tagdependent</code>. If no attribute is specified, the default is <code class="cCode">scriptless</code>.</p><a name="wp89854"> </a><h4 class="pHeading3">Declaring Tag Attributes in Tag Files</h4><a name="wp89855"> </a><p class="pBody">You declare the attributes of a custom tag defined in a tag file with the <code class="cCode">attribute</code> directive. A TLD has an analogous <code class="cCode">attribute</code> element (see <a  href="JSPTags6.html#wp90370">Declaring Tag Attributes for Tag Handlers</a>). <a  href="JSPTags5.html#wp89869">Table 15-3</a> lists the <code class="cCode">attribute</code> directive attributes:</p><div align="left"><table border="1" summary="attribute Directive Attributes" id="wp89869">  <caption><a name="wp89869"> </a><div class="pTableTitle">Table 15-3   attribute Directive Attributes&nbsp;</div></caption>  <tr align="center">    <th><a name="wp89873"> </a><div class="pCellHeading">Attribute</div></th>    <th><a name="wp89875"> </a><div class="pCellHeading">Description</div></th></tr>  <tr align="left">    <td><a name="wp89877"> </a><div class="pCellBody"><code class="cCode">description</code></div></td>    <td><a name="wp89879"> </a><div class="pCellBody">(optional) Description of the attribute. Defaults to no description.</div></td></tr>  <tr align="left">    <td><a name="wp89881"> </a><div class="pCellBody"><code class="cCode">name</code></div></td>    <td><a name="wp89883"> </a><div class="pCellBody">The unique name of the attribute being declared. A translation error results if more than one <code class="cCode">attribute</code> directive appears in the same translation unit with the same <code class="cCode">name</code>.</div><a name="wp89884"> </a><div class="pCellBody">&#160;</div><a name="wp89885"> </a><div class="pCellBody">A translation error results if the value of a <code class="cCode">name</code> attribute of an <code class="cCode">attribute</code> directive is equal to the value of <code class="cCode">dynamic-attributes</code> attribute of a <code class="cCode">tag</code> directive or the value of a <code class="cCode">name-given</code> attribute of a <code class="cCode">variable</code> directive.</div></td></tr>  <tr align="left">    <td><a name="wp89887"> </a><div class="pCellBody"><code class="cCode">required</code></div></td>    <td><a name="wp89889"> </a><div class="pCellBody">(optional) Whether this attribute is required (<code class="cCode">true</code>) or optional (<code class="cCode">false</code>). Defaults to <code class="cCode">false</code>.</div></td></tr>  <tr align="left">    <td><a name="wp89891"> </a><div class="pCellBody"><code class="cCode">rtexprvalue</code></div></td>    <td><a name="wp89893"> </a><div class="pCellBody">(optional) Whether the attribute's value may be dynamically calculated at runtime by an expression. Defaults to <code class="cCode">true</code>.</div></td></tr>  <tr align="left">    <td><a name="wp89895"> </a><div class="pCellBody"><code class="cCode">type</code></div></td>    <td><a name="wp89897"> </a><div class="pCellBody">(optional) The runtime type of the attribute's value. Defaults to <code class="cCode">java.lang.String</code>.</div></td></tr>  <tr align="left">    <td><a name="wp89899"> </a><div class="pCellBody"><code class="cCode">fragment</code></div></td>    <td><a name="wp89901"> </a><div class="pCellBody">(optional) Whether this attribute is a fragment to be evaluated by the tag handler (true) or a normal attribute to be evaluated by the container prior to being passed to the tag handler. </div><a name="wp89902"> </a><div class="pCellBody">&#160;</div><a name="wp89903"> </a><div class="pCellBody">If this attribute is true:</div><a name="wp89904"> </a><div class="pCellBody">You do not specify the <code class="cCode">rtexprvalue</code> attribute. The container fixes the <code class="cCode">rtexprvalue</code> attribute at <code class="cCode">true</code>.</div><a name="wp89905"> </a><div class="pCellBody">You do not specify the <code class="cCode">type</code> attribute. The container fixes the <code class="cCode">type</code> attribute at <code class="cCode">javax.servlet.jsp.tagext.JspFragment</code>.</div><a name="wp89906"> </a><div class="pCellBody">&#160;</div><a name="wp89907"> </a><div class="pCellBody">Defaults to <code class="cCode">false</code>.</div></td></tr></table></div><p class="pBody"></p><a name="wp89909"> </a><h4 class="pHeading3">Declaring Tag Variables in Tag Files</h4><a name="wp89910"> </a><p class="pBody">Tag attributes are used to customize tag behavior much like parameters are used to customize the behavior of object methods. In fact, using tag attributes and EL variables, is it possible to emulate various types of parameters--<code class="cCode">IN</code>, <code class="cCode">OUT</code>, and nested.</p><a name="wp89911"> </a><p class="pBody">To emulate <code class="cCode">IN</code> parameters, use tag attributes. A tag attribute is communicated between the calling page and the tag file when the tag is invoked. No further communication occurs between the calling page and tag file.</p><a name="wp89912"> </a><p class="pBody">To emulate <code class="cCode">OUT</code> or nested parameters, use EL variables. The variable is not initialized by the calling page, but set by the tag file. Each type of parameter is synchronized with the calling page at various points according to the scope of the variable. See <a  href="JSPTags5.html#wp89968">Variable Synchronization</a> for details.</p><a name="wp89916"> </a><p class="pBody">You declare an EL variable exposed by a tag file with the <code class="cCode">variable</code> directive. A TLD has an analogous <code class="cCode">variable</code> element (see <a  href="JSPTags6.html#wp90424">Declaring Tag Variables for Tag Handlers</a>). <a  href="JSPTags5.html#wp89927">Table 15-4</a> lists the <code class="cCode">variable</code> directive attributes:</p><div align="left"><table border="1" summary="variable Directive Attributes" id="wp89927">  <caption><a name="wp89927"> </a><div class="pTableTitle">Table 15-4   variable Directive Attributes</div>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -