Attribute Class

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

public class Attribute

    extends TagSupport
    implements TemplateConstants

The Attribute tag defines an attribute within a template that may be set from a content page. For example, the page's title may be defined as an attribute in the template and then provided by each content page using the template. The attribute has a name and default value. If the content page specifies a value for the attribute it will be used, otherwise the default value is used.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
defaultValueNoNoNo
A default value used for the Attribute if the content page does not provide a value.
nameYesNoNo
The name identifying the Attribute. Any named attribute may be used more than once within a template page.

Related Topics

<netui-template:...> Tags Sample
IncludeSection
Section
SetAttribute
Template
Visible


Hierarchy
Object
  TagSupport
    Attribute
All Implemented Interfaces

IterationTag, Serializable, Tag, TemplateConstants

Field Summary

   
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Fields from interface com.bea.wlw.netui.tags.template.TemplateConstants
TEMPLATE_ATTRIBUTES, TEMPLATE_SECTIONS
 

Constructor Summary

Attribute()

 

Method Summary

public int
doStartTag()
Renders the content of the attribute.
public String
getDefaultValue()
Returns the defaultValue of the Attribute.
public String
getName()
Returns the name of the Attribute.
protected void
localRelease()
Resets all of the fields of the tag.
public void
setDefaultValue(String defaultValue)
Sets the defaultValue for the Attribute.
public void
setName(String name)
Sets the name for the Attribute.
 
Methods from  javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Constructor Detail

Attribute

public Attribute()
 

Method Detail

doStartTag() Method

public int doStartTag()
throws JspException
Renders the content of the attribute.

Overrides
TagSupport.doStartTag()

Returns

EVAL_PAGE to continue evaluation of the page.

Exceptions

JspException
If there is any failure in the tag.

getDefaultValue() Method

public String getDefaultValue()
Returns the defaultValue of the Attribute.

Returns

a String value representing the default value.

getName() Method

public String getName()
Returns the name of the Attribute.

Returns

the name of the Attribute

localRelease() Method

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


setDefaultValue(String) Method

public void setDefaultValue(String defaultValue)
Sets the defaultValue for the Attribute. If the content page does not define a value for this attribute through the SetAttribute tag, then the defaultValue will be used. If neither a value nor defaultValue is set, then the empty String "" will be output.

Parameters

defaultValue
The value to set the defaultValue property.

setName(String) Method

public void setName(String name)
Sets the name for the Attribute. An attribute may be used more than once in a template page.

Parameters

name
The name of the attribute. The name does not need to be unique because it may be used more than once on the page.