# com.bea.wlw.netui.tags.template
SetAttribute Class

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

Attribute Descriptions
Attribute | Required | Runtime Expression Evaluation | Data Bindable
--- | --- | --- | ---
name | Yes | No | No
The name of the Attribute in the template for which this tag sets a value for.
value | Yes | No | Read Only
The value of the Attribute. This may be either a String value or an expression.

Related Topics

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

Hierarchy
  `Object`
  `TagSupport`
  `BodyTagSupport`
  `AbstractBaseTag`
  `SetAttribute`

All Implemented Interfaces
  `BodyTag`, `IterationTag`, `Serializable`, `Tag`, `TemplateConstants`

## Field Summary

Fields from com.bea.wlw.netui.tags`.`AbstractBaseTag``
``ATTR_GENERAL`, `ATTR_GENERAL_EXPRESSION`, `ATTR_JAVASCRIPT`, `ATTR_STYLE`, `CLASS`, `ID`, `JAVASCRIPT_STATUS`, `NAME`, `NETUI_UNIQUE_CNT`, `ONCLICK`, `ONDBLCLICK`, `ONKEYDOWN`, `ONKEYPRESS`, `ONKEYUP`, `ONMOUSEDOWN`, `ONMOUSEMOVE`, `ONMOUSEOUT`, `ONMOUSEOVER`, `ONMOUSEUP`, `STYLE`, `TABINDEX``

Fields from javax.servlet.jsp.tagext`.`BodyTagSupport``
`bodyContent`

Fields from javax.servlet.jsp.tagext`.`TagSupport``
`id, pageContext`

Fields from interface javax.servlet.jsp.tagext`.`BodyTag``
`EVAL_BODY_BUFFERED, EVAL_BODY_TAG`

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

SetAttribute()

## Method Summary

`public int` | `doStartTag`() Tag Lifecycle method called when the tag is first seen.
`public `String`` | `getName`() Return the name of the `Attribute` we are setting an value for.
`public `String`` | `getTagName`() Return the name of the tag.
`public `String`` | `getValue`() Return the `value` value.
`protected void` | `localRelease`() Reset all of the fields of the tag.
`public void` | `setName`(`String` name) Set the `name` of the attribute.
`public void` | `setValue`(`String` value) Set the value of the `Attribute`.

Methods from `com.bea.wlw.netui.tags.`AbstractBaseTag``
``addTagIdMapping`, `evaluateAttributeToString`, `filter`, `filter`, `getJavaScriptUtils`, `getNearestForm`, `getScriptReporter`, `getUserLocale`, `registerTagError`, `release`, `renderAttribute`, `rewriteName`, `write``

Methods from `javax.servlet.jsp.tagext.`BodyTagSupport``
`doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent`

Methods from `javax.servlet.jsp.tagext.`TagSupport``
`doAfterBody, doEndTag, doStartTag, 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.`BodyTag``
`doInitBody, setBodyContent`

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

### SetAttribute

    public SetAttribute()

## Method Detail

### doStartTag() Method

    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`

Overrides
  `BodyTagSupport.doStartTag()`

#### Returns

EVAL_PAGE to continue processing the page.

#### Exceptions

``JspException``
  on error

### getName() Method

    public String getName()

Return the name of the `Attribute` we are setting an value for.

#### Returns

A `String` value representing the name of the Attribute.

### getTagName() Method

    public String getTagName()

Return the name of the tag. This is used by error reporting in the base class `AbstractBaseTag`.

Overrides
  `AbstractBaseTag.getTagName()`

### getValue() Method

    public String getValue()

Return the `value` value. If the value is an expression, the expression will be returned, not the value referred to by the expression.

#### Returns

a `String` value representing the `Attribute` value.

### localRelease() Method

    protected void localRelease()

Reset all of the fields of the tag.

Overrides
  `AbstractBaseTag.localRelease()`

### setName(String) Method

    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(String) Method

    public void setValue(String value)

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.