NetUI Tag Library Documentation (Version 1.0.1)

netui-template
netui-template:includeSection Tag

Defines a content placeholder within a template.

Syntax

<netui-template:includeSection
    [defaultPage="string_defaultPage"]
    name="string_name" >
    ... JSP content ...
</netui-template:includeSection>

Description

Defines a content placeholder within a template. Each placeholder must have a unique name identifying it. Different content pages adopt the template page, set properties on its placeholders (using the <netui-template:section> tag), and render the completed HTML in the browser.

For example, a template page can use the <netui-template:includeSection> tag to define a content placeholder.

In the template JSP page...

      <table>
          <tr>
              <td colspan="3">
                  <netui-template:includeSection name="tableHeader"/>
              </td>
          </tr>

Then a content page can set HTML content in the placeholder using the <netui-template:section> tag.

In a content JSP page...

    <netui-template:section name="tableHeader">
        <h1>HEADER TEXT</h1>
    </netui-template:section>

The HTML rendered in the browser will appear as follows.

      <table>
          <tr>
              <td colspan="3">
                  <h1>HEADER TEXT</h1>
              </td>
          </tr>

If the content page does not define content to be placed in the placeholder, then the defaultPage attribute will be used. The defaultPage attribute points at a stand-alone JSP page. The entire contents of the page will be placed in the placeholder, after any Java elements, such as scriptlets have been resolved.

Attributes
defaultPage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

A default JSP page to provide content for the placeholder if the content page fails to define the content.
name
Required: Yes  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The name of the section. This name must be unique within the template page.

Example

In this sample a <netui-template:includeSection> tag defines a place holder for a table row

    <tr>
        <netui-template:includeSection name="rowPlaceholder" defaultPage="defaultPage.jsp"/>
    </tr>

If there is no content page that sets content into this placeholder using a <netui-template:section> tag, then the entire contents of the defaultPage.jsp will be used. Assume that the defaultPage.jsp appears as follows.

    <p><%= 1 + 1 %></p>
Then the HTML rendered in the browser will appear as follows. Note that the Java scriptlet <%= 1 + 1 %> has been resolved to the value 2.
    <tr>
        <p>2</p>
    </tr>


Tag Information
Tag Classorg.apache.beehive.netui.tags.template.IncludeSection
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone