This tag is used within a template page to define placeholders for HTML content.
<netui-template:includeSection
[defaultPage="string_defaultPage"]
name="string_name" />
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.
<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>
<netui-template:...> Tags Sample
<netui-template:attribute> Tag