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 Template

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.Template
All Implemented Interfaces:
ErrorReporter, 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 Template
extends AbstractBaseTag
implements TemplateConstants, ErrorReporter

This tags defines the template to use within a content page. The content page interacts with the template page through children tags of the Template tag. The legal children are as follows:

The URL of the template file is set as the templatePage attribute on the Template tag. The Template file is included from the Template tag and will include sections defined in the content page. The content is contained in one or more Section tags, which are children of the Template tag. In addition, the content page can set attributes of the template page.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
templatePageYesNoNo
The URL of the template JSP. This is a URL that locates the template JSP page.
reportErrorsNoNoNo
Does the template contain a <netui:html> tag that should report tag errors?

See Also:
Attribute, IncludeSection, Section, SetAttribute, Visible, Serialized Form
Example:
The following example shows a content page that adopts the template.jsp page as its template. The content page also sets the "title" attribute on the template.
    <netui-template:template templatePage="./template.jsp">
    ...
        <netui-template:setAttribute name="title" value="Template Tags Sample"/>
    ...
    </netui-template:template>

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/templateUsingJSP.jsp
Beadoc.see:
<netui-template:...> Tags Sample
Beadoc.tagdescription:
This tag points a content page at its template page. A content page interacts with its template page through children tags of the <netui-template:template> tag. The legal children are as follows:

The URL of the template page is specified by the templatePage attribute on the <netui-template:template> tag.


Nested Class Summary
static class Template.TemplateContext
           
 
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.ErrorReporter
CONTAINER_ERRORS
 
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
Template()
           
 
Method Summary
 void addError(AbstractPageError ape)
          Add an error to the errors being reported by this tag.
 int doEndTag()
          The tag extension lifecycle method called after the tag has processed the body.
 int doStartTag()
          the tag extension lifecycle method called when the tag is first encountered.
 boolean getReportErrors()
          Return a boolean indicating that the template expects the template file to report errors
 String getTagName()
          Returns the name of the Tag.
 String getTemplatePage()
          Return the URL of the template JSP page.
 boolean isReporting()
          This boolean indicates if an ErrorReporter is reporting errors or not.
protected  void localRelease()
          Reset all of the fields of the tag.
 ArrayList returnErrors()
          Return an ArrayList of the errors
 void setReportErrors(boolean reportErrors)
          Set the boolean indicating that the template should report errors.
 void setTemplatePage(String templatePage)
          Set the URL of the template to use.
 
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, 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

Template

public Template()
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

setReportErrors

public void setReportErrors(boolean reportErrors)
Set the boolean indicating that the template should report errors. The errors will be reported through a HTML tag that must be found in the template JSP.

Parameters:
reportErrors - boolean indicating that errors should be reported
Beadoc.attributedescription:
Boolean. Determines if the template should report errors. The errors will be reported inline on the JSP page.
Beadoc.attributesyntaxvalue:
boolean_reportErrors
Beadoc.databindable:
false

getReportErrors

public boolean getReportErrors()
Return a boolean indicating that the template expects the template file to report errors


setTemplatePage

public void setTemplatePage(String templatePage)
Set the URL of the template to use. The templatePage is an URL which identifies the JSP template page.

Parameters:
templatePage - - a URL pointing to a JSP page that represents the template.
Beadoc.attributedescription:
The URL of the template page to use.
Beadoc.attributesyntaxvalue:
string_urlToTemplatePage
Beadoc.databindable:
false

getTemplatePage

public String getTemplatePage()
Return the URL of the template JSP page.

Returns:
a String representing the URL of the JSP template.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
the tag extension lifecycle method called when the tag is first encountered. This will cause the body of the tag to be evaluated.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
int indicating that the body should be evaluated.
Throws:
javax.servlet.jsp.JspException - on errors.

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
The tag extension lifecycle method called after the tag has processed the body. This method will include the template JSP page specified by the templatePage attribute. The contents of the template are made available to the template page.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_PAGE to skip all processing after the template.
Throws:
javax.servlet.jsp.JspException - on all errors. The most common error is an error indicating that the JSP page representing the Template isn't found.

localRelease

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

Overrides:
localRelease in class AbstractBaseTag

addError

public void addError(AbstractPageError ape)
Add an error to the errors being reported by this tag.

Specified by:
addError in interface ErrorReporter
Parameters:
ape - - The AbstractPageError to add

returnErrors

public ArrayList returnErrors()
Return an ArrayList of the errors

Specified by:
returnErrors in interface ErrorReporter
Returns:
an ArrayList of all errors.

isReporting

public boolean isReporting()
This boolean indicates if an ErrorReporter is reporting errors or not. The caller should check this before calling addError because the ErrorReporter may be off for some reason.

Specified by:
isReporting in interface ErrorReporter
Returns:
a boolean indicating if the tag is reporting errors or not.

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