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:
$Revision: 1.21 $ $Date: 2003/05/15 23:43:42 $

Author:
Craig R. McClanahan

Field Summary

protected String
bundle
The servlet context attribute key for our resources.
protected static Locale
defaultLocale
Deprecated. Use Locale.getDefault() directly.
protected static String
lineEnd
The line ending string.
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
property
The name of the property for which error messages should be returned, or null to return all errors.

Method Summary

int
doStartTag()
Render the specified error messages if there are any.
String
getBundle()
String
getLocale()
String
getName()
String
getProperty()
void
release()
Release any acquired resources.
void
setBundle(String bundle)
void
setLocale(String locale)
void
setName(String name)
void
setProperty(String property)

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.


lineEnd

protected static String lineEnd
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).


property

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

Method Details

doStartTag

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


getBundle

public String getBundle()


getLocale

public String getLocale()


getName

public String getName()


getProperty

public String getProperty()


release

public void release()
Release any acquired resources.


setBundle

public void setBundle(String bundle)


setLocale

public void setLocale(String locale)


setName

public void setName(String name)


setProperty

public void setProperty(String property)


Copyright B) 2000-2005 - Apache Software Foundation