org.apache.beehive.netui.tags.template
Class IncludeSection
Object
TagSupport
BodyTagSupport
AbstractClassicTag
IncludeSection
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag, TemplateConstants
public class IncludeSection
- extends AbstractClassicTag
- implements TemplateConstants
Used within a template JSP page to define a placeholder for section content.
Within a template, one or more sections are defined within the overall
structure of the page. Each section has a unique name identifying it.
The content page, through the Section
tag, provides content
that is included into the defined sections.
All content found within the body of the IncludeSection
is ignored.
- See Also:
- Serialized Form
- 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>
Fields inherited from class BodyTagSupport |
bodyContent |
Fields inherited from class TagSupport |
id, pageContext |
Fields inherited from interface BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Method Summary |
int |
doStartTag()
Renders the content of the section into the template. |
String |
getTagName()
Returns the name of the Tag. |
protected void |
localRelease()
Resets all of the fields of the tag. |
void |
setDefaultPage(String defaultPage)
Sets a default JSP page to provide content for the section if
the content page does not define the content. |
void |
setName(String name)
Sets the name of the section. |
Methods inherited from class AbstractClassicTag |
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write |
Methods inherited from class BodyTagSupport |
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
getParent, setPageContext, setParent |
IncludeSection
public IncludeSection()
getTagName
public String getTagName()
- Returns the name of the Tag. This is used to
identify the type of tag reporting errors.
- Specified by:
getTagName
in interface INetuiTag
- Specified by:
getTagName
in class AbstractClassicTag
- Returns:
- the name of the tag.
setName
public void setName(String name)
- Sets the name of the section. This name must be unique within
the template page.
- Parameters:
name
- The name of the defined section within the template.
This name must be unique within the template.
setDefaultPage
public void setDefaultPage(String defaultPage)
- Sets a default JSP page to provide content for the section if
the content page does not define the content.
- Parameters:
defaultPage
- a URL identifying a JSP or HTML page
providing default content to the defined section.
doStartTag
public int doStartTag()
throws JspException
- Renders the content of the section into the template. Errors
are reported inline within the template in development
mode. If no sections are defined an error is reported. If
a section is not defined and no default URL is provided an
error is reported.
- Specified by:
doStartTag
in interface Tag
- Overrides:
doStartTag
in class BodyTagSupport
- Returns:
- SKIP_BODY to skip any content found in the tag.
- Throws:
JspException
- on Errors.
localRelease
protected void localRelease()
- Resets all of the fields of the tag.
- Overrides:
localRelease
in class AbstractClassicTag