java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.struts.taglib.wml.ErrorsTag
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
- public class ErrorsTag
- extends javax.servlet.jsp.tagext.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:
- $Revision: 1.2 $
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 |
HEADER
private static java.lang.String HEADER
FOOTER
private static java.lang.String FOOTER
PREFIX
private static java.lang.String PREFIX
SUFFIX
private static java.lang.String SUFFIX
NEW_LINE
private static java.lang.String NEW_LINE
bundle
protected java.lang.String bundle
- The servlet context attribute key for our resources.
defaultLocale
protected static java.util.Locale defaultLocale
- The default locale on our server.
locale
protected java.lang.String locale
- The session attribute key for our locale.
messages
protected static org.apache.struts.util.MessageResources messages
- The message resources for this package.
name
protected java.lang.String name
- The request attribute key for our error messages (if any).
property
protected java.lang.String property
- The name of the property for which error messages should be returned,
or
null
to return all errors.
ErrorsTag
public ErrorsTag()
getBundle
public java.lang.String getBundle()
setBundle
public void setBundle(java.lang.String bundle)
getLocale
public java.lang.String getLocale()
setLocale
public void setLocale(java.lang.String locale)
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
getProperty
public java.lang.String getProperty()
setProperty
public void setProperty(java.lang.String property)
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Render the specified error messages if there are any.
release
public void release()
- Release any acquired resources.