org.springframework.web.servlet.tags.form
Class ErrorsTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.springframework.web.servlet.tags.RequestContextAwareTag
org.springframework.web.servlet.tags.HtmlEscapingAwareTag
org.springframework.web.servlet.tags.form.AbstractFormTag
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag
org.springframework.web.servlet.tags.form.ErrorsTag
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally
public class ErrorsTag
- extends AbstractHtmlElementBodyTag
- implements BodyTag
Form tag for displaying errors for a particular field or object.
This tag supports three main usage patterns:
- Field only - set '
path
' to the field name (or path)
- Object errors only - omit '
path
'
- All errors - set '
path
' to '*
'
- Since:
- 2.0
- Author:
- Rob Harrop
- See Also:
- Serialized Form
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag |
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag |
getCssClass, getCssErrorClass, getCssStyle, getDir, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MESSAGES_ATTRIBUTE
public static final String MESSAGES_ATTRIBUTE
- See Also:
- Constant Field Values
SPAN_TAG
public static final String SPAN_TAG
- The HTML '
span
' tag.
- See Also:
- Constant Field Values
ErrorsTag
public ErrorsTag()
setDelimiter
public void setDelimiter(String delimiter)
- Sets what delimiter must be used between error messages.
Defaults to an HTML '<br/>
' tag.
- Parameters:
delimiter
- said delimeter
getName
protected String getName()
throws JspException
- Gets the value for the HTML '
name
' attribute.
Appends '.errors
' to the value returned by AbstractDataBoundFormElementTag.getPath()
.
- Overrides:
getName
in class AbstractDataBoundFormElementTag
- Returns:
- the value for the HTML '
name
' attribute.
- Throws:
JspException
- See Also:
AbstractDataBoundFormElementTag.getPath()
shouldRender
protected boolean shouldRender()
throws JspException
- Should rendering of this tag proceed at all?
Only renders output when there are errors for the configured path
.
- Overrides:
shouldRender
in class AbstractHtmlElementBodyTag
- Returns:
true
only when there are errors for the configured path
- Throws:
JspException
onWriteTagContent
protected void onWriteTagContent()
- Make sure we are under a '
form
' tag before proceeding.
- Overrides:
onWriteTagContent
in class AbstractHtmlElementBodyTag
renderDefaultContent
protected void renderDefaultContent(TagWriter tagWriter)
throws JspException
- Specified by:
renderDefaultContent
in class AbstractHtmlElementBodyTag
- Throws:
JspException
exposeAttributes
protected void exposeAttributes()
throws JspException
- Description copied from class:
AbstractHtmlElementBodyTag
- Called during
AbstractHtmlElementBodyTag.writeTagContent(org.springframework.web.servlet.tags.form.TagWriter)
allowing subclasses to add any attributes to the
PageContext
as needed.
- Overrides:
exposeAttributes
in class AbstractHtmlElementBodyTag
- Throws:
JspException
removeAttributes
protected void removeAttributes()
- Description copied from class:
AbstractHtmlElementBodyTag
- Called by
AbstractHtmlElementBodyTag.doFinally()
allowing subclasses to remove any attributes from the
PageContext
as needed.
- Overrides:
removeAttributes
in class AbstractHtmlElementBodyTag
Copyright © 2002-2006 The Spring Framework.