# com.bea.wlw.netui.tags.html
Error Class

public class Error
extends `AbstractBaseTag`

Renders an error message with a given error key value if that key can be found in the ActionErrors registered in the `pageContext` at `org.apache.struts.action.Action.ERROR_KEY`. Error ignores its body content.

The following optional message keys will be utilized if corresponding messages exist for them in the application resources:

- error.prefix - If present, the corresponding message will be rendered before each individual error message.
- error.suffix - If present, the corresponding message will be rendered after each individual error message.

Attribute Descriptions
Attribute | Required | Runtime Expression Evaluation | Data Bindable
--- | --- | --- | ---
bundle | No | No | No
The message bundle where the error message can be found
locale | No | No | No
The session attribute key for the locale
value | Yes | No | Read Only
The value for getting the error key

Related Topics

Form Validation Sample
``Errors``

Hierarchy
  `Object`
  `TagSupport`
  `BodyTagSupport`
  `AbstractBaseTag`
  `Error`

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

## Field Summary

`protected `String`` | `bundle` The message bundle where the error messages can be found.
`protected static `Locale`` | `defaultLocale` The default locale on the server.
`protected `String`` | `locale` The session attribute key for the locale.
`protected `String`` | `value` The value for getting the error key.

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`

## Constructor Summary

Error()

## Method Summary

`public int` | `doStartTag`() Render the specified error message if it can be found.
`public `String`` | `getBundle`() Returns the name of the message bundle.
`public `String`` | `getLocale`() Returns the name of the locale attribute.
`public `String`` | `getTagName`() Return the name of the Tag.
`public `String`` | `getValue`() Returns the value of the error key.
`protected void` | `localRelease`() Release any acquired resources.
`public void` | `setBundle`(`String` bundle) Set the name of the message bundle.
`public void` | `setLocale`(`String` locale) Set the name of the locale attribute.
`public void` | `setValue`(`String` value) Set the value of the error key.

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`

## Field Detail

### bundle

    protected String bundle

  The message bundle where the error messages can be found. This defaults to org.apache.struts.action.Action.MESSAGES_KEY.

### defaultLocale

    protected static Locale defaultLocale

  The default locale on the server.

### locale

    protected String locale

  The session attribute key for the locale. This defaults to org.apache.struts.action.Action.LOCALE_KEY.

### value

    protected String value

  The value for getting the error key. This is either a keyname or an expression which gets the key name.

## Constructor Detail

### Error

    public Error()

## Method Detail

### doStartTag() Method

    public int doStartTag()
         throws JspException

Render the specified error message if it can be found.

Overrides
  `BodyTagSupport.doStartTag()`

#### Exceptions

``JspException``
  if a JSP exception has occurred

### getBundle() Method

    public String getBundle()

Returns the name of the message bundle.

#### Returns

the bundle's name

### getLocale() Method

    public String getLocale()

Returns the name of the locale attribute.

#### Returns

the locale attribute name

### getTagName() Method

    public String getTagName()

Return the name of the Tag.

Overrides
  `AbstractBaseTag.getTagName()`

### getValue() Method

    public String getValue()

Returns the value of the error key.

#### Returns

the error key value

### localRelease() Method

    protected void localRelease()

Release any acquired resources.

Overrides
  `AbstractBaseTag.localRelease()`

### setBundle(String) Method

    public void setBundle(String bundle)

Set the name of the message bundle.

#### Parameters

bundle
  - the bundle name

### setLocale(String) Method

    public void setLocale(String locale)

Set the name of the locale attribute.

#### Parameters

locale
  - the locale attribute name

### setValue(String) Method

    public void setValue(String value)

Set the value of the error key.

#### Parameters

value
  - the error key value