|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.apache.struts.taglib.html Class ErrorsTag
java.lang.Object | +--javax.servlet.jsp.tagext.TagSupport | +--org.apache.struts.taglib.html.ErrorsTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- NestedErrorsTag
- 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:
- $Rev: 164530 $ $Date: 2005-04-25 04:11:07 +0100 (Mon, 25 Apr 2005) $
- See Also:
- Serialized Form
Field Summary | |
protected java.lang.String |
bundle
The servlet context attribute key for our resources. |
protected static java.util.Locale |
defaultLocale
Deprecated. Use Locale.getDefault() directly. |
protected java.lang.String |
footer
The message resource key for errors footer. |
protected java.lang.String |
header
The message resource key for errors header. |
protected static java.lang.String |
lineEnd
Deprecated. No longer used. |
protected java.lang.String |
locale
The session attribute key for our locale. |
protected static MessageResources |
messages
The message resources for this package. |
protected java.lang.String |
name
The request attribute key for our error messages (if any). |
protected java.lang.String |
prefix
The message resource key for errors prefix. |
protected java.lang.String |
property
The name of the property for which error messages should be returned, or null to return all errors. |
protected java.lang.String |
suffix
The message resource key for errors suffix. |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext, parent, values |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
ErrorsTag()
|
Method Summary | |
int |
doStartTag()
Render the specified error messages if there are any. |
java.lang.String |
getBundle()
|
java.lang.String |
getFooter()
|
java.lang.String |
getHeader()
|
java.lang.String |
getLocale()
|
java.lang.String |
getName()
|
java.lang.String |
getPrefix()
|
java.lang.String |
getProperty()
|
java.lang.String |
getSuffix()
|
void |
release()
Release any acquired resources. |
void |
setBundle(java.lang.String bundle)
|
void |
setFooter(java.lang.String footer)
|
void |
setHeader(java.lang.String header)
|
void |
setLocale(java.lang.String locale)
|
void |
setName(java.lang.String name)
|
void |
setPrefix(java.lang.String prefix)
|
void |
setProperty(java.lang.String property)
|
void |
setSuffix(java.lang.String suffix)
|
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
|
Field Detail |
bundle
protected java.lang.String bundle
- The servlet context attribute key for our resources.
defaultLocale
protected static java.util.Locale defaultLocale
- Deprecated. Use Locale.getDefault() directly.
- The default locale on our server.
lineEnd
protected static java.lang.String lineEnd
- Deprecated. No longer used.
- The line ending string.
locale
protected java.lang.String locale
- The session attribute key for our locale.
messages
protected static 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.
header
protected java.lang.String header
- The message resource key for errors header.
footer
protected java.lang.String footer
- The message resource key for errors footer.
prefix
protected java.lang.String prefix
- The message resource key for errors prefix.
suffix
protected java.lang.String suffix
- The message resource key for errors suffix.
Constructor Detail |
ErrorsTag
public ErrorsTag()
Method Detail |
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)
getHeader
public java.lang.String getHeader()
setHeader
public void setHeader(java.lang.String header)
getFooter
public java.lang.String getFooter()
setFooter
public void setFooter(java.lang.String footer)
getPrefix
public java.lang.String getPrefix()
setPrefix
public void setPrefix(java.lang.String prefix)
getSuffix
public java.lang.String getSuffix()
setSuffix
public void setSuffix(java.lang.String suffix)
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException
- Render the specified error messages if there are any.
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
- if a JSP exception has occurred
release
public void release()
- Release any acquired resources.
- Overrides:
release
in classjavax.servlet.jsp.tagext.TagSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2000-2005 - The Apache Software Foundation