org.apache.struts.taglib.html

Class ErrorsTag

Known Direct 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:

Version:
$Rev: 164530 $ $Date: 2005-04-25 04:11:07 +0100 (Mon, 25 Apr 2005) $

Field Summary

protected String
bundle
The servlet context attribute key for our resources.
protected static Locale
defaultLocale
Deprecated. Use Locale.getDefault() directly.
protected String
footer
The message resource key for errors footer.
protected String
header
The message resource key for errors header.
protected static String
lineEnd
Deprecated. No longer used.
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.

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)

Field Details

bundle

protected String bundle
The servlet context attribute key for our resources.

defaultLocale

protected static Locale defaultLocale

Deprecated. Use Locale.getDefault() directly.

The default locale on our server.

footer

protected String footer
The message resource key for errors footer.

header

protected String header
The message resource key for errors header.

lineEnd

protected static String lineEnd

Deprecated. No longer used.

The line ending string.

locale

protected String locale
The session attribute key for our locale.

messages

protected static MessageResources messages
The message resources for this package.

name

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

prefix

protected String prefix
The message resource key for errors prefix.

property

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

suffix

protected String suffix
The message resource key for errors suffix.

Method Details

doStartTag

public int doStartTag()
            throws JspException
Render the specified error messages if there are any.

getBundle

public String getBundle()

getFooter

public String getFooter()

getHeader

public String getHeader()

getLocale

public String getLocale()

getName

public String getName()

getPrefix

public String getPrefix()

getProperty

public String getProperty()

getSuffix

public String getSuffix()

release

public void release()
Release any acquired resources.

setBundle

public void setBundle(String bundle)

setFooter

public void setFooter(String footer)

setHeader

public void setHeader(String header)

setLocale

public void setLocale(String locale)

setName

public void setName(String name)

setPrefix

public void setPrefix(String prefix)

setProperty

public void setProperty(String property)

setSuffix

public void setSuffix(String suffix)

Copyright B) 2000-2007 - The Apache Software Foundation