|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTagSupport
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
public class ErrorsTag
Form tag for displaying errors for a particular field or object.
This tag supports three main usage patterns:
path
' to the field name (or path)path
'path
' to '*
'
Field Summary | |
---|---|
private java.lang.String |
delimiter
|
private java.lang.String |
element
|
private boolean |
errorMessagesWereExposed
|
static java.lang.String |
MESSAGES_ATTRIBUTE
The key under which this tag exposes error messages in the page context scope . |
private java.lang.Object |
oldMessages
Stores any value that existed in the 'errors messages' before the tag was started. |
static java.lang.String |
SPAN_TAG
The HTML ' span ' tag. |
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 |
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag |
---|
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME |
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag |
---|
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE |
Constructor Summary | |
---|---|
ErrorsTag()
|
Method Summary | |
---|---|
protected java.lang.String |
autogenerateId()
Get the value for the HTML ' id ' attribute. |
protected void |
exposeAttributes()
Exposes any bind status error messages under this key
in the PageContext#PAGE_SCOPE . |
java.lang.String |
getDelimiter()
Return the delimiter to be used between error messages. |
java.lang.String |
getElement()
Get the HTML element must be used to render the error messages. |
protected java.lang.String |
getName()
Get the value for the HTML ' name ' attribute. |
protected void |
removeAttributes()
Removes any bind status error messages that were previously stored under this key in the PageContext#PAGE_SCOPE . |
protected void |
renderDefaultContent(TagWriter tagWriter)
|
void |
setDelimiter(java.lang.String delimiter)
Set the delimiter to be used between error messages. |
void |
setElement(java.lang.String element)
Set the HTML element must be used to render the error messages. |
protected boolean |
shouldRender()
Should rendering of this tag proceed at all? |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag |
---|
doEndTag, doFinally, doInitBody, flushBufferedBodyContent, onWriteTagContent, renderFromBodyContent, setBodyContent, writeTagContent |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag |
---|
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag |
---|
convertToDisplayString, getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag |
---|
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute |
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag |
---|
isHtmlEscape, setHtmlEscape |
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag |
---|
doCatch, doStartTag, getRequestContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MESSAGES_ATTRIBUTE
page context scope
.
public static final java.lang.String SPAN_TAG
span
' tag.
private java.lang.String element
private java.lang.String delimiter
private java.lang.Object oldMessages
private boolean errorMessagesWereExposed
Constructor Detail |
---|
public ErrorsTag()
Method Detail |
---|
public void setElement(java.lang.String element)
Defaults to an HTML '<span/>
' tag.
public java.lang.String getElement()
public void setDelimiter(java.lang.String delimiter)
Defaults to an HTML '<br/>
' tag.
public java.lang.String getDelimiter()
protected java.lang.String autogenerateId() throws JspException
id
' attribute.
Appends '.errors
' to the value returned by AbstractDataBoundFormElementTag.getPropertyPath()
or to the model attribute name if the <form:errors/>
tag's
'path
' attribute has been omitted.
autogenerateId
in class AbstractDataBoundFormElementTag
id
' attribute
JspException
AbstractDataBoundFormElementTag.getPropertyPath()
protected java.lang.String getName() throws JspException
name
' attribute.
Simply returns null
because the 'name
' attribute
is not a validate attribute for the 'span
' element.
getName
in class AbstractDataBoundFormElementTag
name
' attribute
JspException
protected boolean shouldRender() throws JspException
Only renders output when there are errors for the configured path
.
shouldRender
in class AbstractHtmlElementBodyTag
true
only when there are errors for the configured path
JspException
protected void renderDefaultContent(TagWriter tagWriter) throws JspException
renderDefaultContent
in class AbstractHtmlElementBodyTag
JspException
protected void exposeAttributes() throws JspException
this key
in the PageContext#PAGE_SCOPE
.
Only called if shouldRender()
returns true
.
exposeAttributes
in class AbstractHtmlElementBodyTag
JspException
removeAttributes()
protected void removeAttributes()
this key
in the PageContext#PAGE_SCOPE
.
removeAttributes
in class AbstractHtmlElementBodyTag
exposeAttributes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |