spring-framework / org.springframework.web.servlet.tags.form

Package org.springframework.web.servlet.tags.form

Types

AbstractDataBoundFormElementTag

abstract class AbstractDataBoundFormElementTag : AbstractFormTag, EditorAwareTag

Base tag for all data-binding aware JSP form tags.

Provides the common path and id properties. Provides sub-classes with utility methods for accessing the BindStatus of their bound value and also for interacting with the TagWriter.

AbstractHtmlElementBodyTag

abstract class AbstractHtmlElementBodyTag : AbstractHtmlElementTag, BodyTag

Convenient super class for many html tags that render content using the databinding features of the AbstractHtmlElementTag. The only thing sub-tags need to do is override #renderDefaultContent(TagWriter).

ButtonTag

open class ButtonTag : AbstractHtmlElementTag

The <button> tag renders a form field label in an HTML 'button' tag. It is provided for completeness if the application relies on a RequestDataValueProcessor.

Attribute Summary Attribute Required? Runtime Expression? Description

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

id

false

true

HTML Standard Attribute

name

false

true

The name attribute for the HTML button tag

value

false

true

The name attribute for the HTML button tag

CheckboxTag

open class CheckboxTag : AbstractSingleCheckedElementTag

The <checkbox> tag renders an HTML 'input' tag with type 'checkbox'. May be used in one of three different approaches depending on the type of the bound value. Approach One When the bound value is of type Boolean then the 'input(checkbox)' is marked as 'checked' if the bound value is true. The 'value' attribute corresponds to the resolved value of the value property. Approach Two When the bound value is of type Collection then the 'input(checkbox)' is marked as 'checked' if the configured value is present in the bound Collection. Approach Three For any other bound value type, the 'input(checkbox)' is marked as 'checked' if the configured value is equal to the bound value.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

label

false

true

Value to be displayed as part of the tag

lang

false

true

HTML Standard Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

value

false

true

HTML Optional Attribute

CheckboxesTag

open class CheckboxesTag : AbstractMultiCheckedElementTag

The <checkboxes> tag renders multiple HTML 'input' tags with type 'checkbox'. Intended to be used with a Collection as the #getItems() bound value.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

delimiter

false

true

Delimiter to use between each 'input' tag with type 'checkbox'. There is no delimiter by default.

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

element

false

true

Specifies the HTML element that is used to enclose each 'input' tag with type 'checkbox'. Defaults to 'span'.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

itemLabel

false

true

Value to be displayed as part of the 'input' tags with type 'checkbox'

items

true

true

The Collection, Map or array of objects used to generate the 'input' tags with type 'checkbox'

itemValue

false

true

Name of the property mapped to 'value' attribute of the 'input' tags with type 'checkbox'

lang

false

true

HTML Standard Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

ErrorsTag

open class ErrorsTag : AbstractHtmlElementBodyTag, BodyTag

The <errors> tag renders field errors in an HTML 'span' tag. Displays errors for either an object or a particular field.

This tag supports three main usage patterns:

  1. Field only - set 'path' to the field name (or path)
  2. Object errors only - omit 'path'
  3. All errors - set 'path' to '*'

Attribute Summary Attribute Required? Runtime Expression? Description

cssClass

false

true

HTML Optional Attribute

cssStyle

false

true

HTML Optional Attribute

delimiter

false

true

Delimiter for displaying multiple error messages. Defaults to the br tag.

dir

false

true

HTML Standard Attribute

element

false

true

Specifies the HTML element that is used to render the enclosing errors.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

lang

false

true

HTML Standard Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

false

true

Path to errors object for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

HiddenInputTag

open class HiddenInputTag : AbstractHtmlElementTag

The <hidden> tag renders an HTML 'input' tag with type 'hidden' using the bound value.

Example (binding to 'name' property of form backing object):

 <form:hidden path="name"/> 

Attribute Summary Attribute Required? Runtime Expression? Description

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

path

true

true

Path to property for data binding

InputTag

open class InputTag : AbstractHtmlInputElementTag

The <input> tag renders an HTML 'input' tag with type 'text' using the bound value.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

alt

false

true

HTML Optional Attribute

autocomplete

false

true

Common Optional Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

lang

false

true

HTML Standard Attribute

maxlength

false

true

HTML Optional Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

onselect

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

readonly

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will make the HTML element readonly.

size

false

true

HTML Optional Attribute

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

LabelTag

open class LabelTag : AbstractHtmlElementTag

The <label> tag renders a form field label in an HTML 'label' tag.

See the "formTags" showcase application that ships with the full Spring distribution for an example of this class in action.

Attribute Summary Attribute Required? Runtime Expression? Description

cssClass

false

true

HTML Optional Attribute.

cssErrorClass

false

true

HTML Optional Attribute. Used only when errors are present.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

for

false

true

HTML Standard Attribute

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

lang

false

true

HTML Standard Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

true

true

Path to errors object for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

OptionTag

open class OptionTag : AbstractHtmlElementBodyTag, BodyTag

The <option> tag renders a single HTML 'option'. Sets 'selected' as appropriate based on bound value.

Must be used nested inside a SelectTag.

Provides full support for databinding by marking an 'option' as 'selected' if the value matches the value bound to the out SelectTag.

The value property is required and corresponds to the 'value' attribute of the rendered 'option'.

An optional label property can be specified, the value of which corresponds to inner text of the rendered 'option' tag. If no label is specified then the value property will be used when rendering the inner text.

Attribute Summary Attribute Required? Runtime Expression? Description

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

label

false

true

HTML Optional Attribute

lang

false

true

HTML Standard Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

value

true

true

HTML Optional Attribute

OptionsTag

open class OptionsTag : AbstractHtmlElementTag

The <options> tag renders a list of HTML 'option' tags. Sets 'selected' as appropriate based on bound value.

Must be used within a SelectTag.

Attribute Summary Attribute Required? Runtime Expression? Description

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

itemLabel

false

true

Name of the property mapped to the inner text of the 'option' tag

items

true

true

The Collection, Map or array of objects used to generate the inner 'option' tags

itemValue

false

true

Name of the property mapped to 'value' attribute of the 'option' tag

lang

false

true

HTML Standard Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

PasswordInputTag

open class PasswordInputTag : InputTag

The <password> tag renders an HTML 'input' tag with type 'password' using the bound value.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

alt

false

true

HTML Optional Attribute

autocomplete

false

true

Common Optional Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

lang

false

true

HTML Standard Attribute

maxlength

false

true

HTML Optional Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

onselect

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

readonly

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will make the HTML element readonly.

showPassword

false

true

Is the password value to be shown? Defaults to false.

size

false

true

HTML Optional Attribute

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

RadioButtonTag

open class RadioButtonTag : AbstractSingleCheckedElementTag

The <radiobutton> tag renders an HTML 'input' tag with type 'radio'.

Rendered elements are marked as 'checked' if the configured value matches the bound value.

A typical usage pattern will involved multiple tag instances bound to the same property but with different values.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

label

false

true

Value to be displayed as part of the tag

lang

false

true

HTML Standard Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

value

false

true

HTML Optional Attribute

RadioButtonsTag

open class RadioButtonsTag : AbstractMultiCheckedElementTag

The <radiobuttons> tag renders multiple HTML 'input' tags with type 'radio'.

Rendered elements are marked as 'checked' if the configured value matches the bound value.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

delimiter

false

true

Delimiter to use between each 'input' tag with type 'radio'. There is no delimiter by default.

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

element

false

true

Specifies the HTML element that is used to enclose each 'input' tag with type 'radio'. Defaults to 'span'.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

itemLabel

false

true

Value to be displayed as part of the 'input' tags with type 'radio'

items

true

true

The Collection, Map or array of objects used to generate the 'input' tags with type 'radio'

itemValue

false

true

Name of the property mapped to 'value' attribute of the 'input' tags with type 'radio'

lang

false

true

HTML Standard Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute

TextareaTag

open class TextareaTag : AbstractHtmlInputElementTag

The <textarea> tag renders an HTML 'textarea'.

Attribute Summary Attribute Required? Runtime Expression? Description

accesskey

false

true

HTML Standard Attribute

cols

false

true

HTML Required Attribute

cssClass

false

true

HTML Optional Attribute

cssErrorClass

false

true

HTML Optional Attribute. Used when the bound field has errors.

cssStyle

false

true

HTML Optional Attribute

dir

false

true

HTML Standard Attribute

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.

id

false

true

HTML Standard Attribute

lang

false

true

HTML Standard Attribute

onblur

false

true

HTML Event Attribute

onchange

false

true

HTML Event Attribute

onclick

false

true

HTML Event Attribute

ondblclick

false

true

HTML Event Attribute

onfocus

false

true

HTML Event Attribute

onkeydown

false

true

HTML Event Attribute

onkeypress

false

true

HTML Event Attribute

onkeyup

false

true

HTML Event Attribute

onmousedown

false

true

HTML Event Attribute

onmousemove

false

true

HTML Event Attribute

onmouseout

false

true

HTML Event Attribute

onmouseover

false

true

HTML Event Attribute

onmouseup

false

true

HTML Event Attribute

onselect

false

true

HTML Event Attribute

path

true

true

Path to property for data binding

readonly

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will make the HTML element readonly.

rows

false

true

HTML Required Attribute

tabindex

false

true

HTML Standard Attribute

title

false

true

HTML Standard Attribute