ErrorsTag (Struts Taglib 1.3.10 API)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.taglib.html
Class ErrorsTag

    java.lang.Object
      javax.servlet.jsp.tagext.TagSupport
          org.apache.struts.taglib.html.ErrorsTag

All Implemented Interfaces:
  Serializable, IterationTag, Tag

Direct Known Subclasses:
  NestedErrorsTag

    public class ErrorsTag

extends TagSupport

Custom tag that renders error messages if an appropriate request attribute has been created. The tag looks for a request attribute with a reserved key, and assumes that it is either a String, a String array, containing message keys to be looked up in the module's MessageResources, or an object of type `org.apache.struts.action.ActionErrors`.

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

- errors.header - If present, the corresponding message will be rendered prior to the individual list of error messages.
- errors.footer - If present, the corresponding message will be rendered following the individual list of error messages.
- errors.prefix - If present, the corresponding message will be rendered before each individual error message.
- errors.suffix - If present, the corresponding message will be rendered after each individual error message.

Version:
  $Rev: 471754 $ $Date: 2005-08-21 19:08:45 -0400 (Sun, 21 Aug 2005) $
See Also:
  Serialized Form

Field Summary
`protected String` | `bundle` The servlet context attribute key for our resources.
`protected String` | `footer` The message resource key for errors footer.
`protected String` | `header` The message resource key for errors header.
`protected String` | `locale` The session attribute key for our locale.
`protected static MessageResources` | `messages` The message resources for this package.
`protected String` | `name` The request attribute key for our error messages (if any).
`protected String` | `prefix` The message resource key for errors prefix.
`protected String` | `property` The name of the property for which error messages should be returned, or `null` to return all errors.
`protected String` | `suffix` The message resource key for errors suffix.

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

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
`ErrorsTag()`

Method Summary
`int` | `doStartTag()` Render the specified error messages if there are any.
`String` | `getBundle()`
`String` | `getFooter()`
`String` | `getHeader()`
`String` | `getLocale()`
`String` | `getName()`
`String` | `getPrefix()`
`String` | `getProperty()`
`String` | `getSuffix()`
`void` | `release()` Release any acquired resources.
`void` | `setBundle(String bundle)`
`void` | `setFooter(String footer)`
`void` | `setHeader(String header)`
`void` | `setLocale(String locale)`
`void` | `setName(String name)`
`void` | `setPrefix(String prefix)`
`void` | `setProperty(String property)`
`void` | `setSuffix(String suffix)`

Methods inherited from class javax.servlet.jsp.tagext.TagSupport
`doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### messages

    protected static MessageResources messages

  The message resources for this package.

### bundle

    protected String bundle

  The servlet context attribute key for our resources.

### locale

    protected String locale

  The session attribute key for our locale.

### name

    protected String name

  The request attribute key for our error messages (if any).

### property

    protected String property

  The name of the property for which error messages should be returned, or `null` to return all errors.

### header

    protected String header

  The message resource key for errors header.

### footer

    protected String footer

  The message resource key for errors footer.

### prefix

    protected String prefix

  The message resource key for errors prefix.

### suffix

    protected String suffix

  The message resource key for errors suffix.

Constructor Detail

### ErrorsTag

    public ErrorsTag()

Method Detail

### getBundle

    public String getBundle()

### setBundle

    public void setBundle(String bundle)

### getLocale

    public String getLocale()

### setLocale

    public void setLocale(String locale)

### getName

    public String getName()

### setName

    public void setName(String name)

### getProperty

    public String getProperty()

### setProperty

    public void setProperty(String property)

### getHeader

    public String getHeader()

### setHeader

    public void setHeader(String header)

### getFooter

    public String getFooter()

### setFooter

    public void setFooter(String footer)

### getPrefix

    public String getPrefix()

### setPrefix

    public void setPrefix(String prefix)

### getSuffix

    public String getSuffix()

### setSuffix

    public void setSuffix(String suffix)

### doStartTag

    public int doStartTag()
                   throws JspException

  Render the specified error messages if there are any.

  Specified by:
    `doStartTag` in interface `Tag`
  Overrides:
    `doStartTag` in class `TagSupport`
  Throws:
    `JspException` - if a JSP exception has occurred

### release

    public void release()

  Release any acquired resources.

  Specified by:
    `release` in interface `Tag`
  Overrides:
    `release` in class `TagSupport`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.