org.apache.struts.taglib.html

Class ErrorsTag

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 Stringbundle
The servlet context attribute key for our resources.
protected static LocaledefaultLocale
The default locale on our server.
protected Stringfooter
The message resource key for errors footer.
protected Stringheader
The message resource key for errors header.
protected static StringlineEnd
The line ending string.
protected Stringlocale
The session attribute key for our locale.
protected static MessageResourcesmessages
The message resources for this package.
protected Stringname
The request attribute key for our error messages (if any).
protected Stringprefix
The message resource key for errors prefix.
protected Stringproperty
The name of the property for which error messages should be returned, or null to return all errors.
protected Stringsuffix
The message resource key for errors suffix.
Method Summary
intdoStartTag()
Render the specified error messages if there are any.
StringgetBundle()
StringgetFooter()
StringgetHeader()
StringgetLocale()
StringgetName()
StringgetPrefix()
StringgetProperty()
StringgetSuffix()
voidrelease()
Release any acquired resources.
voidsetBundle(String bundle)
voidsetFooter(String footer)
voidsetHeader(String header)
voidsetLocale(String locale)
voidsetName(String name)
voidsetPrefix(String prefix)
voidsetProperty(String property)
voidsetSuffix(String suffix)

Field Detail

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 Detail

doStartTag

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

Throws: JspException if a JSP exception has occurred

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 © 2000-2008 - The Apache Software Foundation