public class ErrorsTag extends AbstractHtmlElementBodyTag implements javax.servlet.jsp.tagext.BodyTag
This tag supports three main usage patterns:
path' to the field name (or path)path'path' to '*'| Modifier and Type | Field and Description |
|---|---|
static String |
MESSAGES_ATTRIBUTE
The key under which this tag exposes error messages in
the
page context scope. |
static String |
SPAN_TAG
The HTML '
span' tag. |
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_ATTRIBUTECOMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAMElogger, REQUEST_CONTEXT_PAGE_ATTRIBUTE| Constructor and Description |
|---|
ErrorsTag() |
| Modifier and Type | Method and Description |
|---|---|
protected 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. |
String |
getDelimiter()
Return the delimiter to be used between error messages.
|
String |
getElement()
Get the HTML element must be used to render the error messages.
|
protected 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(String delimiter)
Set the delimiter to be used between error messages.
|
void |
setElement(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?
|
doEndTag, doFinally, doInitBody, flushBufferedBodyContent, onWriteTagContent, renderFromBodyContent, setBodyContent, writeTagContentgetCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, isValidDynamicAttribute, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributesconvertToDisplayString, getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, processFieldValue, resolveId, setId, setPathcreateTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttributeisHtmlEscape, setHtmlEscapedoCatch, doStartTag, getRequestContextdoAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValuepublic static final String MESSAGES_ATTRIBUTE
page context scope.public static final String SPAN_TAG
span' tag.public void setElement(String element)
Defaults to an HTML '<span/>' tag.
public String getElement()
public void setDelimiter(String delimiter)
Defaults to an HTML '<br/>' tag.
public String getDelimiter()
protected String autogenerateId() throws javax.servlet.jsp.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 AbstractDataBoundFormElementTagid' attributejavax.servlet.jsp.JspExceptionAbstractDataBoundFormElementTag.getPropertyPath()protected String getName() throws javax.servlet.jsp.JspException
name' attribute.
Simply returns null because the 'name' attribute
is not a validate attribute for the 'span' element.
getName in class AbstractDataBoundFormElementTagname' attributejavax.servlet.jsp.JspExceptionprotected boolean shouldRender()
throws javax.servlet.jsp.JspException
Only renders output when there are errors for the configured path.
shouldRender in class AbstractHtmlElementBodyTagtrue only when there are errors for the configured pathjavax.servlet.jsp.JspExceptionprotected void renderDefaultContent(TagWriter tagWriter) throws javax.servlet.jsp.JspException
renderDefaultContent in class AbstractHtmlElementBodyTagjavax.servlet.jsp.JspExceptionprotected void exposeAttributes()
throws javax.servlet.jsp.JspException
this key
in the PageContext.PAGE_SCOPE.
Only called if shouldRender() returns true.
exposeAttributes in class AbstractHtmlElementBodyTagjavax.servlet.jsp.JspExceptionremoveAttributes()protected void removeAttributes()
this key in the PageContext.PAGE_SCOPE.removeAttributes in class AbstractHtmlElementBodyTagexposeAttributes()Copyright © 2015. All rights reserved.