|
|||
TAG LIBRARIES: <netui> | <netui-data> | <netui-template> | |||
DETAIL: Syntax | Description | Attributes | Example | Implementing Class: org.apache.beehive.netui.tags.template.IncludeSection |
Defines a content placeholder within a template.
Syntax |
<netui-template:includeSection
[defaultPage="defaultPage"]
name="name" />
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 |
|
||||||
name |
|
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 LIBRARIES: <netui> | <netui-data> | <netui-template> | |||
DETAIL: Syntax | Description | Attributes | Example | Implementing Class: org.apache.beehive.netui.tags.template.IncludeSection |