public class BindTag extends HtmlEscapingAwareTag implements EditorAwareTag
BindStatus,
to both Java expressions and JSP EL expressions.
Can be used to bind to any bean or bean property in the model. The specified path determines whether the tag exposes the status of the bean itself (showing object-level errors), a specific bean property (showing field errors), or a matching set of bean properties (showing all corresponding field errors).
The Errors object that has
been bound using this tag is exposed to collaborating tags, as well
as the bean property that this errors object applies to. Nested tags
such as the TransformTag can access those exposed properties.
setPath(java.lang.String),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static String |
STATUS_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "status".
|
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTEid, pageContextEVAL_BODY_AGAINEVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE| Constructor and Description |
|---|
BindTag() |
| Modifier and Type | Method and Description |
|---|---|
int |
doEndTag() |
void |
doFinally() |
protected int |
doStartTagInternal()
Called by doStartTag to perform the actual work.
|
PropertyEditor |
getEditor()
Retrieve the PropertyEditor for the property that this tag is
currently bound to.
|
Errors |
getErrors()
Retrieve the Errors instance that this tag is currently bound to.
|
String |
getPath()
Return the path that this tag applies to.
|
String |
getProperty()
Retrieve the property that this tag is currently bound to,
or
null if bound to an object rather than a specific property. |
boolean |
isIgnoreNestedPath()
Return whether to ignore a nested path, if any.
|
void |
setIgnoreNestedPath(boolean ignoreNestedPath)
Set whether to ignore a nested path, if any.
|
void |
setPath(String path)
Set the path that this tag should apply.
|
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscapedoCatch, doStartTag, getRequestContextdoAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValuepublic static final String STATUS_VARIABLE_NAME
public void setPath(String path)
Errors.getGlobalErrors(),
Errors.getFieldErrors()public String getPath()
public void setIgnoreNestedPath(boolean ignoreNestedPath)
public boolean isIgnoreNestedPath()
protected final int doStartTagInternal()
throws Exception
RequestContextAwareTagdoStartTagInternal in class RequestContextAwareTagException - any exception, any checked one other than
a JspException gets wrapped in a JspException by doStartTagTagSupport.doStartTag()public int doEndTag()
doEndTag in interface TagdoEndTag in class TagSupportpublic final String getProperty()
null if bound to an object rather than a specific property.
Intended for cooperating nesting tags.null if nonepublic final Errors getErrors()
null if nonepublic final PropertyEditor getEditor()
EditorAwareTaggetEditor in interface EditorAwareTagnull if nonepublic void doFinally()
doFinally in interface TryCatchFinallydoFinally in class RequestContextAwareTag