Package org.springframework.web.servlet.tags

# Class BindErrorsTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.springframework.web.servlet.tags.RequestContextAwareTag
org.springframework.web.servlet.tags.HtmlEscapingAwareTag
org.springframework.web.servlet.tags.BindErrorsTag

All Implemented Interfaces:
  `IterationTag`, `JspTag`, `Tag`, `TryCatchFinally`, `Serializable`

public class BindErrorsTag extends HtmlEscapingAwareTag
This `<hasBindErrors>` tag provides an `Errors` instance in case of bind errors. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).

Attribute Summary
Attribute | Required? | Runtime Expression? | Description
--- | --- | --- | ---
htmlEscape | false | true | Set HTML escaping for this tag, as boolean value. Overrides the default HTML escaping setting for the current page.
name | true | true | The name of the bean in the request that needs to be inspected for errors. If errors are available for this bean, they will be bound under the 'errors' key.

Author:
  Rod Johnson, Juergen Hoeller
See Also:
  - `BindTag`
  - `Errors`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ERRORS_VARIABLE_NAME`
Page context attribute containing `Errors`.

### Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag

`logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE`

### Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

`id, pageContext`

### Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

`EVAL_BODY_AGAIN`

### Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

## Constructor Summary

Constructors
Constructor
Description
`BindErrorsTag()`

## Method Summary

Modifier and Type
Method
Description
`int`
`doEndTag()`
`void`
`doFinally()`
`protected final int`
`doStartTagInternal()`
Called by doStartTag to perform the actual work.
`final org.springframework.validation.Errors`
`getErrors()`
Retrieve the Errors instance that this tag is currently bound to.
`String`
`getName()`
Return the name of the bean that this tag checks.
`void`
`setName(String name)`
Set the name of the bean that this tag should check.

### Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag

`htmlEscape, isDefaultHtmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscape`

### Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag

`doCatch, doStartTag, getRequestContext`

### Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

`doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### ERRORS_VARIABLE_NAME

public static final String ERRORS_VARIABLE_NAME
Page context attribute containing `Errors`.

See Also:
  - Constant Field Values

## Constructor Details

### BindErrorsTag

public BindErrorsTag()

## Method Details

### setName

public void setName(String name)
Set the name of the bean that this tag should check.

### getName

public String getName()
Return the name of the bean that this tag checks.

### doStartTagInternal

protected final int doStartTagInternal() throws ServletException, JspException
Description copied from class: `RequestContextAwareTag`
Called by doStartTag to perform the actual work.

Specified by:
  `doStartTagInternal` in class `RequestContextAwareTag`
Returns:
  same as TagSupport.doStartTag
Throws:
  `ServletException`
  `JspException`
See Also:
  - `TagSupport.doStartTag()`

### doEndTag

public int doEndTag()

Specified by:
  `doEndTag` in interface `Tag`
Overrides:
  `doEndTag` in class `TagSupport`

### getErrors

@Nullable public final org.springframework.validation.Errors getErrors()
Retrieve the Errors instance that this tag is currently bound to.

Intended for cooperating nesting tags.

### doFinally

public void doFinally()

Specified by:
  `doFinally` in interface `TryCatchFinally`
Overrides:
  `doFinally` in class `RequestContextAwareTag`