org.apache.struts.taglib.html

Class MessagesTag

public class MessagesTag extends BodyTagSupport

Custom tag that iterates the elements of a message collection. It defaults to retrieving the messages from Globals.ERROR_KEY, but if the message attribute is set to true then the messages will be retrieved from Globals.MESSAGE_KEY. This is an alternative to the default ErrorsTag.

Since: Struts 1.1

Version: $Rev: 264662 $ $Date: 2005-08-30 01:11:09 +0100 (Tue, 30 Aug 2005) $

Field Summary
protected Stringbundle
The servlet context attribute key for our resources.
protected Stringfooter
The message resource key for errors footer.
protected Stringheader
The message resource key for errors header.
protected Stringid
The name of the scripting variable to be exposed.
protected Iteratoriterator
Iterator of the elements of this error collection, while we are actually running.
protected Stringlocale
The session attribute key for our locale.
protected Stringmessage
If this is set to 'true', then the Globals.MESSAGE_KEY will be used to retrieve the messages from scope.
protected static MessageResourcesmessageResources
The message resources for this package.
protected Stringname
The request attribute key for our error messages (if any).
protected booleanprocessed
Whether or not any error messages have been processed.
protected Stringproperty
The name of the property for which error messages should be returned, or null to return all errors.
Method Summary
intdoAfterBody()
Make the next collection element available and loop, or finish the iterations if there are no more elements.
intdoEndTag()
Clean up after processing this enumeration.
intdoStartTag()
Construct an iterator for the specified collection, and begin looping through the body once per element.
StringgetBundle()
StringgetFooter()
StringgetHeader()
StringgetId()
StringgetLocale()
StringgetMessage()
StringgetName()
StringgetProperty()
voidrelease()
Release all allocated resources.
voidsetBundle(String bundle)
voidsetFooter(String footer)
voidsetHeader(String header)
voidsetId(String id)
voidsetLocale(String locale)
voidsetMessage(String message)
voidsetName(String name)
voidsetProperty(String property)

Field Detail

bundle

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

footer

protected String footer
The message resource key for errors footer.

header

protected String header
The message resource key for errors header.

id

protected String id
The name of the scripting variable to be exposed.

iterator

protected Iterator iterator
Iterator of the elements of this error collection, while we are actually running.

locale

protected String locale
The session attribute key for our locale.

message

protected String message
If this is set to 'true', then the Globals.MESSAGE_KEY will be used to retrieve the messages from scope.

messageResources

protected static MessageResources messageResources
The message resources for this package.

name

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

processed

protected boolean processed
Whether or not any error messages have been processed.

property

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

Method Detail

doAfterBody

public int doAfterBody()
Make the next collection element available and loop, or finish the iterations if there are no more elements.

Throws: JspException if a JSP exception has occurred

doEndTag

public int doEndTag()
Clean up after processing this enumeration.

Throws: JspException if a JSP exception has occurred

doStartTag

public int doStartTag()
Construct an iterator for the specified collection, and begin looping through the body once per element.

Throws: JspException if a JSP exception has occurred

getBundle

public String getBundle()

getFooter

public String getFooter()

getHeader

public String getHeader()

getId

public String getId()

getLocale

public String getLocale()

getMessage

public String getMessage()

getName

public String getName()

getProperty

public String getProperty()

release

public void release()
Release all allocated resources.

setBundle

public void setBundle(String bundle)

setFooter

public void setFooter(String footer)

setHeader

public void setHeader(String header)

setId

public void setId(String id)

setLocale

public void setLocale(String locale)

setMessage

public void setMessage(String message)

setName

public void setName(String name)

setProperty

public void setProperty(String property)
Copyright © 2000-2008 - The Apache Software Foundation