| NetUI Tag Library Documentation (Version 1.0.2) | ||||||
DETAIL: Syntax | Description | Attributes | Example | Tag Info |
FRAMES NO FRAMES |
Defines a content placeholder within a template.
Syntax |
<netui-template:includeSection
[defaultPage="string_defaultPage"]
name="string_name" >
... JSP content ...
</netui-template:includeSection>
Description |
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 |
A default JSP page to provide content for the placeholder if the content page fails to define the content. |
|
name |
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 Class | org.apache.beehive.netui.tags.template.IncludeSection |
TagExtraInfo Class | None |
Body Content | JSP |
Display Name | None |
|
||||||
DETAIL: Syntax | Description | Attributes | Example | Tag Info |
FRAMES NO FRAMES |