org.apache.beehive.netui.tags.template
Class SetAttribute

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by SetAttribute
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag, TemplateConstants

public class SetAttribute
extends AbstractClassicTag
implements TemplateConstants

Set an Attribute value defined in a template. This tag is used in content pages to set the value of attributes defined in a template. The attribute value will override any default value defined on the Attribute.

See Also:
Serialized Form
Example

Assume a <netui-template:attribute> tag defines a value placeholder within a <td> tag

    <td colspan="3" bgcolor="<netui-template:attribute name="headerColor" defaultValue="#ffffff"/>">

Now a content JSP page can control the background color of the <td>.

    <netui-template:setAttribute name="headerColor" value="lightgreen"/>
The HTML rendered in the browser will appear as follows.
    <td colspan="3" bgcolor="lightgreen">

Field Summary
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface TemplateConstants
TEMPLATE_ATTRIBUTES, TEMPLATE_SECTIONS
 
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
 
Constructor Summary
SetAttribute()
           
 
Method Summary
 int doStartTag()
          Tag Lifecycle method called when the tag is first seen.
 String getTagName()
          Return the name of the tag.
protected  void localRelease()
          Reset all of the fields of the tag.
 void setName(String name)
          Set the name of the attribute.
 void setValue(String value)
          Set the value of the Attribute.
 
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
 

Constructor Detail

SetAttribute

public SetAttribute()
Method Detail

getTagName

public String getTagName()
Return the name of the tag. This is used by error reporting in the base class AbstractBaseTag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractClassicTag
Returns:
the name of the tag.

setName

public void setName(String name)
Set the name of the attribute.

Parameters:
name - The name of the Attribute in the template for which this tags sets the value.

setValue

public void setValue(String value)
              throws JspException
Set the value of the Attribute. This attribute may be assigned a read only expression.

Parameters:
value - The value to use for the Attribute in the template.
Throws:
JspException

doStartTag

public int doStartTag()
               throws JspException
Tag Lifecycle method called when the tag is first seen. This method will add the Attribute value to a HashMap stored in the request allowing the template to access the value. If there are errors, the error text will be placed into the attribute value. Nothing is written into the ServletResponse

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Returns:
EVAL_PAGE to continue processing the page.
Throws:
JspException - on error

localRelease

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

Overrides:
localRelease in class AbstractClassicTag