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

📄 struts-tiles.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
        Name of the attribute.
      </td>
</tr>
<tr class="oddRow">
<td align="center">value</td>
<td>
        Attribute value. Could be a String or an Object.
       Value can come from a direct assignment (value="aValue") or from a bean.
       One of 'value' 'content' or 'beanName' must be present.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">content</td>
<td>
      Content that's put into tile scope.
      Synonym to value. Attribute added for compatibility with JSP Template.
      
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">direct</td>
<td>
      Determines how content is handled: true means content is
      printed <em>direct</em>ly; false, the default, means content
      is included.
      This is another way to specify content type. If 'direct=true' content is 'string', if
      'direct=false', content is 'page'.
      Attribute added for compatibility with JSP Template.
      </td>
</tr>
<tr class="evenRow">
<td align="center">type</td>
<td>
      Specify content type: string, page, template or definition.
      <ul>
      <li>String : Content is printed directly.</li>
      <li>page | template : Content is included from specified URL. Name is used as an URL.</li>
      <li>definition : Value is the name of a definition defined in factory (xml file). Definition will be searched
      in the inserted tile, in a <code>&lt;tiles:insert attribute="attributeName"&gt;</code> tag, where 'attributeName'
      is the name used for this tag.</li>
      </ul>
      If 'type' attribute is not specified, content is 'untyped', unless it comes from a typed bean.
      </td>
</tr>
<tr class="oddRow">
<td align="center">beanName</td>
<td>
      Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise,
      method pageContext.findAttribute is used.
      If beanProperty is specified, retrieve value from the corresponding bean property.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">beanProperty</td>
<td>
      Bean property name. If specified, value is retrieve from this property. Support nested/indexed
      properties.
      
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">beanScope</td>
<td>
      Scope into which bean is searched. If not specified, method pageContext.findAttribute is used.
      Scope can be any JSP scope, 'tile', 'component', or 'template'.
      In these three later cases, bean is search in tile/component/template context.
      </td>
</tr>
<tr class="evenRow">
<td align="center">role</td>
<td>
      If the user is in the specified role, the tag is taken into account;
      otherwise, the tag is ignored (skipped).
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="putList">
<strong>putList</strong> - 
      Declare a list that will be pass as attribute to tile.
    </h3>
<div class="indent">
      Declare a list that will be pass as attribute to tile.
      List elements are added using the tag 'add'.
      This tag can only be used inside 'insert' or 'definition' tag.
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
        Name of the list.
      
            [Required]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="add">
<strong>add</strong> - 
       Add an element to the surrounding list.
       Equivalent to 'put', but for list element.
    </h3>
<div class="indent">
       Add an element to the surrounding list.
       This tag can only be used inside putList tag.
       Value can come from a direct assignment (value="aValue") or from a bean.
       One of 'value' or 'beanName' must be present.
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">value</td>
<td>
        Element value. Can be a String or Object.
      </td>
</tr>
<tr class="oddRow">
<td align="center">content</td>
<td>
      Element value. Can be a String or Object.
      Synonym to value. Attribute added for compatibility with JSP Template.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">direct</td>
<td>
      Determines how content is handled: true means content is
      printed <em>direct</em>ly; false, the default, means content
      is included.
      This is another way to specify content type. If 'direct=true' content is 'string', if
      'direct=false', content is 'page'.
      Attribute added for compatibility with JSP Template.
      </td>
</tr>
<tr class="oddRow">
<td align="center">type</td>
<td>
      Specify content type: string, page, template or instance.
      <ul>
      <li>String : Content is printed directly.</li>
      <li>page | template : Content is included from specified URL. Name is used as an URL.</li>
      <li>definition : Value denote a definition defined in factory (xml file). Definition will be searched
      in the inserted tile, in a <code>&lt;insert attribute="attributeName"&gt;</code> tag, where 'attributeName'
      is the name used for this tag.</li>
      </ul>
      If 'type' attribute is not specified, content is 'untyped', unless it comes from a typed bean.
      </td>
</tr>
<tr class="evenRow">
<td align="center">beanName</td>
<td>
      Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise,
      method pageContext.findAttribute is used.
      If beanProperty is specified, retrieve value from the corresponding bean property.
      
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">beanProperty</td>
<td>
      Bean property name. If specified, value is retrieve from this property. Support nested/indexed
      properties.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">beanScope</td>
<td>
      Scope into which bean is searched. If not specified, method pageContext.findAttribute is used.
      Scope can be any JSP scope, 'component', or 'template'.
      In these two later cases, bean is search in tile/component/template context.
      </td>
</tr>
<tr class="oddRow">
<td align="center">role</td>
<td>
      <p>If the user is in the specified role, the tag is taken into account;
      otherwise, the tag is ignored (skipped).</p>
      <p>
      The role isn't taken into account if &lt;add&gt; tag is used in a definition.</p>
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="get">
<strong>get</strong> - 
    Gets the content from request scope that was put there by a
    put tag.
    </h3>
<div class="indent">
    <p>Retrieve content from tile context and include it.</p>
    <p>Take into account the 'type' attribute.</p>
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
      The name of the content to get from tile/component scope.
      
            [Required]
          
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">ignore</td>
<td>
      If this attribute is set to true, and the attribute specified by the name
      does not exist, simply return without writing anything. The default value is false, which will
      cause a runtime exception to be thrown.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">flush</td>
<td>
        True or false. If true, current page  out stream is flushed before insertion.
      </td>
</tr>
<tr class="oddRow">
<td align="center">role</td>
<td>
      If the user is in the specified role, the tag is taken into account;
      otherwise, the tag is ignored (skipped).
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="getAsString">
<strong>getAsString</strong> - 
      Render the value of the specified tile/component/template attribute to the current JspWriter
    </h3>
<div class="indent">
      Retrieve the value of the specified tile/component/template attribute property, and render it to the current JspWriter as a String.
      The usual toString() conversions is applied on found value.
      <p>Throw a JSPException if named value is not found.</p>
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
        Attribute name.
      
            [Required]
          
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">ignore</td>
<td>
      If this attribute is set to true, and the attribute specified by the name
      does not exist, simply return without writing anything. The default value is false, which will
      cause a runtime exception to be thrown.
      
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">role</td>
<td>
      If the user is in the specified role, the tag is taken into account;
      otherwise, the tag is ignored (skipped).
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="useAttribute">
<strong>useAttribute</strong> - 
      Use attribute value inside page.
    </h3>
<div class="indent">
      <p>
      Declare a Java variable, and an attribute in the specified scope, using tile attribute value.
      </p>
      <p>
      Java variable and attribute will have the name specified by 'id', or the original name if not
      specified.
      </p>
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">id</td>
<td>
        Declared attribute and variable name.
      </td>
</tr>
<tr class="oddRow">
<td align="center">classname</td>
<td>
        Class of the declared variable.
      </td>
</tr>
<tr class="evenRow">
<td align="center">scope</td>
<td>
        Scope of the declared attribute. Default to 'page'.
      </td>
</tr>
<tr class="oddRow">
<td align="center">name</td>
<td>
        Tile's attribute name.
      
            [Required]
          
            [RT Expr]
          </td>
</tr>
<tr class="evenRow">
<td align="center">ignore</td>
<td>
      If this attribute is set to true, and the attribute specified by the name
      does not exist, simply return without error. The default value is false, which will
      cause a runtime exception to be thrown.
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="importAttribute">
<strong>importAttribute</strong> - 
      Import Tile's attribute in specified context.
    </h3>
<div class="indent">
      Import attribute from tile to requested scope.
      Attribute name and scope are optional. If not specified, all tile
      attributes are imported in page scope.
      Once imported, an attribute can be used as any other beans from jsp contexts.
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">name</td>
<td>
        Tile's attribute name. If not specified, all attributes are imported.
      
            [RT Expr]
          </td>
</tr>
<tr class="oddRow">
<td align="center">scope</td>
<td>
        Scope into which attribute is imported. Default to page.
      </td>
</tr>
<tr class="evenRow">
<td align="center">ignore</td>
<td>
      If this attribute is set to true, and the attribute specified by the name
      does not exist, simply return without error. The default value is false, which will
      cause a runtime exception to be thrown.
      
            [RT Expr]
          </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="initComponentDefinitions">
<strong>initComponentDefinitions</strong> - 
      Initialize Tile/Component definitions factory.
    </h3>
<div class="indent">
      <p>Initialize Tile/Components definitions factory.</p>
      <p>
      In order to use Tile/Component definitions factory, you need to initialize the factory.
      This is generally done in a initializing servlet. In particular, it is done in
      "ComponentActionServlet" if you use it.
      If you don't initialize factory in a servlet, you can initialize it using this tag. You need
      to provide the description file name, and optionally the factory classname.
      Initialization is done only once, at the first call of this tag. Subsequent calls
      are ignored (tag checks existence of the factory.
      </p>
    <table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">file</td>
<td>
        Definition file name.
      
            [Required]
          </td>
</tr>
<tr class="oddRow">
<td align="center">classname</td>
<td>
        If specified, classname of the factory to create and initialized.
      </td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>

</div>
<!--end main-->
</div>
<!--end content-->
<div id="footer">
<img id="powered-logo" alt="Powered by Struts" src="../images/struts-power.gif" />
        Copyright (c) 2000-2005, The Apache Software Foundation <span class="noprint">- 
        <a href="http://wiki.apache.org/struts/StrutsDocComments">Comments?</a>
</span>
</div>
<!--end footer-->
</body>
</html>

⌨️ 快捷键说明

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