BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.template
Class IncludeSection

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.template.IncludeSection
All Implemented Interfaces:
HtmlConstants, TemplateConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class IncludeSection
extends AbstractBaseTag
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.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
nameYesNoNo
The name of the section placeholder. The name must be unique within a template.
defaultPageNoNoNo
A URL identifying a default JSP or HTML page to provide content if the content page does not.

See Also:
Attribute, Section, SetAttribute, Template, Visible, 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>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/template.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/defaultPage.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/templateUsingJSP.jsp
Beadoc.see:
<netui-template:...> Tags Sample
Beadoc.tagdescription:
This tag is used within a template page to define placeholders for HTML content. Each placeholder must have a unique name identifying it. Different content pages adopt the template page, set properties on its placeholders (using the 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 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.


Field Summary
 
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface com.bea.wlw.netui.tags.template.TemplateConstants
TEMPLATE_ATTRIBUTES, TEMPLATE_SECTIONS
 
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
IncludeSection()
           
 
Method Summary
 int doStartTag()
          Renders the content of the section into the template.
 String getDefaultPage()
          Returns the URL of the JSP or HTML page providing default content to the defined section.
 String getName()
          Returns the name of the defined section within the template file.
 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 com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

IncludeSection

public IncludeSection()
Method Detail

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 class AbstractBaseTag

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.
Beadoc.attributedescription:
The name of the section. This name must be unique within the template page.
Beadoc.attributesyntaxvalue:
string_name
Beadoc.databindable:
false

getName

public String getName()
Returns the name of the defined section within the template file.

Returns:
the name of the IncludeSection being defined.

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.
Beadoc.attributedescription:
A default JSP page to provide content for the placeholder if the content page fails to define the content.
Beadoc.attributesyntaxvalue:
string_defaultPage
Beadoc.databindable:
false

getDefaultPage

public String getDefaultPage()
Returns the URL of the JSP or HTML page providing default content to the defined section.

Returns:
the URL of the default content.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.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 javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY to skip any content found in the tag.
Throws:
javax.servlet.jsp.JspException - on Errors.

localRelease

protected void localRelease()
Resets all of the fields of the tag.

Overrides:
localRelease in class AbstractBaseTag

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.