You are on page 1of 21

5/9/13

Appendix E. spring-form.tld

Appendix E. spring-form.tld E.1. Introduction


One of the view technologies you can use with the Spring Framework is Java Server Pages (JSPs). To help you implement views using Java Server Pages the Spring Framework provides you with some tags for evaluating errors, setting themes and outputting internationalized messages. Please note that the various tags generated by this form tag library are compliant with the XHTML-1.0-Strict specification and attendant DTD. This appendix describes the s p r i n g f o r m . t l dtag library.
Section E.2, The checkbox tag Section E.3, The checkboxes tag Section E.4, The errors tag Section E.5, The form tag Section E.6, The hidden tag Section E.7, The input tag Section E.8, The label tag Section E.9, The option tag Section E.10, The options tag Section E.11, The password tag Section E.12, The radiobutton tag Section E.13, The radiobuttons tag Section E.14, The select tag Section E.15, The textarea tag

E.2. The

c h e c k b o xtag

Renders an HTML 'input' tag with type 'checkbox'.

Table E.1. Attributes

Attribute
accesskey cssClass

Required?
false false

Runtime Description Expression?


true true HTML Standard Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has
1/21

cssErrorClass

false

true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

errors. Equivalent to "style" - HTML Optional NEWSLETTER true SUBSC RIPTION cssStyle false Search Documentation all Attribute dir false true HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute Value to be displayed as part of the tag HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Standard Attribute

disabled

false

true

htmlEscape id label lang onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex

false false false false false false false false false false false false false false false false false true false

true true true true true true true true true true true true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

2/21

5/9/13

Appendix E. spring-form.tld

title value

false false

true true

HTML Standard Attribute HTML Optional Attribute

E.3. The

c h e c k b o x e stag

Renders multiple HTML 'input' tags with type 'checkbox'.

Table E.2. Attributes

Attribute
accesskey cssClass

Required?
false false

Runtime Description Expression?


true true HTML Standard Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute Delimiter to use between each 'input' tag with type 'checkbox'. There is no delimiter by default. HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Specifies the HTML element that is used to enclose each 'input' tag with type 'checkbox'. Defaults to 'span'. Enable/disable HTML escaping of rendered values. HTML Standard Attribute Value to be displayed as part of the 'input' tags with type 'checkbox' The Collection, Map or array of objects used to generate the 'input' tags with type
3/21

cssErrorClass

false

true

cssStyle

false

true

delimiter

false

true

dir

false

true

disabled

false

true

element

false

true

htmlEscape id itemLabel

false false false

true true true

items

true

true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

'checkbox' Name of the property mapped to 'value' attribute of the 'input' tags with type 'checkbox' HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Standard Attribute HTML Standard Attribute

itemValue

false

true

lang onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex title

false false false false false false false false false false false false false false true false false

true true true true true true true true true true true true true true true true true

E.4. The

e r r o r stag

Renders field errors in an HTML 'span' tag.

Table E.3. Attributes


static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html 4/21

5/9/13

Appendix E. spring-form.tld

Attribute
cssClass

Required?
false

Runtime Description Expression?


true Equivalent to "class" - HTML Optional Attribute Equivalent to "style" - HTML Optional Attribute Delimiter for displaying multiple error messages. Defaults to the br tag. HTML Standard Attribute Specifies the HTML element that is used to render the enclosing errors. Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to errors object for data binding HTML Standard Attribute HTML Standard Attribute

cssStyle

false

true

delimiter dir element

false false false

true true true

htmlEscape id lang onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex title

false false false false false false false false false false false false false false false false

true true true true true true true true true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/21

5/9/13

Appendix E. spring-form.tld

E.5. The

f o r mtag

Renders an HTML 'form' tag and exposes a binding path to inner tags for binding.

Table E.4. Attributes

Attribute

Required?

Runtime Description Expression?


Specifies the list of character encodings for input data that is accepted by the server processing this form. The value is a space- and/or comma-delimited list of charset values. The client must interpret this list as an exclusive-or list, i.e., the server is able to accept any single character encoding per entity received. HTML Required Attribute Common Optional Attribute Name of the model attribute under which the form object is exposed. Defaults to 'command'. Equivalent to "class" - HTML Optional Attribute Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute HTML Optional Attribute Name of the model attribute under which the form object is exposed. Defaults to 'command'. HTML Standard Attribute - added for
6/21

acceptCharset

false

true

action autocomplete

false false

true true

commandName

false

true

cssClass

false

true

cssStyle dir enctype htmlEscape

false false false false

true true true true

id lang method

false false false

true true true

modelAttribute

false

true

name

false

true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

backwards compatibility cases onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onreset onsubmit target title false false false false false false false false false false false false false false true true true true true true true true true true true true true true HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Optional Attribute HTML Standard Attribute

E.6. The

h i d d e ntag

Renders an HTML 'input' tag with type 'hidden' using the bound value.

Table E.5. Attributes

Attribute Required?
htmlEscape id path false false true

Runtime Expression?
true true true

Description
Enable/disable HTML escaping of rendered values. HTML Standard Attribute Path to property for data binding
7/21

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

E.7. The

i n p u ttag

Renders an HTML 'input' tag with type 'text' using the bound value.

Table E.6. Attributes

Attribute
accesskey alt autocomplete cssClass

Required?
false false false false

Runtime Description Expression?


true true true true HTML Standard Attribute HTML Optional Attribute Common Optional Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape id lang maxlength onblur onchange onclick

false false false false false false false

true true true true true true true

HTML Optional Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

8/21

5/9/13

Appendix E. spring-form.tld

ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect path

false false false false false false false false false false false true

true true true true true true true true true true true true

HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will make the HTML element readonly. HTML Optional Attribute HTML Standard Attribute HTML Standard Attribute

readonly

false

true

size tabindex title

false false false

true true true

E.8. The

l a b e ltag

Renders a form field label in an HTML 'label' tag.

Table E.7. Attributes

Attribute
cssClass

Required?
false

Runtime Description Expression?


true Equivalent to "class" - HTML Optional Attribute.
9/21

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

cssErrorClass

false

true

Equivalent to "class" - HTML Optional Attribute. Used only when errors are present. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Standard Attribute Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to errors object for data binding HTML Standard Attribute HTML Standard Attribute

cssStyle dir for htmlEscape id lang onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex title

false false false false false false false false false false false false false false false false true false false

true true true true true true true true true true true true true true true true true true true

E.9. The

o p t i o ntag
10/21

Renders a single HTML 'option'. Sets 'selected' as appropriate based on bound value.
static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

Table E.8. Attributes

Attribute
cssClass

Required?
false

Runtime Description Expression?


true Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Optional Attribute HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Standard Attribute
11/21

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape id label lang onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup tabindex

false false false false false false false false false false false false false false false

true true true true true true true true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

title value

false true

true true

HTML Standard Attribute HTML Optional Attribute

E.10. The

o p t i o n stag

Renders a list of HTML 'option' tags. Sets 'selected' as appropriate based on bound value.

Table E.9. Attributes

Attribute
cssClass

Required?
false

Runtime Description Expression?


true Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute Name of the property mapped to the inner text of the 'option' tag The Collection, Map or array of objects used to generate the inner 'option' tags Name of the property mapped to 'value' attribute of the 'option' tag HTML Standard Attribute HTML Event Attribute
12/21

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape id itemLabel

false false false

true true true

items

true

true

itemValue lang onclick

false false false

true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup tabindex title

false false false false false false false false false false false

true true true true true true true true true true true

HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Standard Attribute HTML Standard Attribute

E.11. The

p a s s w o r dtag

Renders an HTML 'input' tag with type 'password' using the bound value.

Table E.10. Attributes

Attribute
accesskey alt autocomplete cssClass

Required?
false false false false

Runtime Description Expression?


true true true true HTML Standard Attribute HTML Optional Attribute Common Optional Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute
13/21

cssErrorClass

false

true

cssStyle

false

true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

dir

false

true

HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute HTML Optional Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will make the HTML element readonly.

disabled

false

true

htmlEscape id lang maxlength onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect path

false false false false false false false false false false false false false false false false false false true

true true true true true true true true true true true true true true true true true true true

readonly

false

true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

14/21

5/9/13

Appendix E. spring-form.tld

showPassword

false

true

Is the password value to be shown? Defaults to false. HTML Optional Attribute HTML Standard Attribute HTML Standard Attribute

size tabindex title

false false false

true true true

E.12. The

r a d i o b u t t o ntag

Renders an HTML 'input' tag with type 'radio'.

Table E.11. Attributes

Attribute
accesskey cssClass

Required?
false false

Runtime Description Expression?


true true HTML Standard Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape

false

true

id label lang onblur

false false false false

true true true true

Value to be displayed as part of the tag HTML Standard Attribute HTML Event Attribute

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

15/21

5/9/13

Appendix E. spring-form.tld

onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex title value

false false false false false false false false false false false false true false false false

true true true true true true true true true true true true true true true true

HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Standard Attribute HTML Standard Attribute HTML Optional Attribute

E.13. The

r a d i o b u t t o n stag

Renders multiple HTML 'input' tags with type 'radio'.

Table E.12. Attributes

Attribute
accesskey cssClass

Required?
false false

Runtime Description Expression?


true true HTML Standard Attribute Equivalent to "class" - HTML Optional Attribute
16/21

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

cssErrorClass

false

true

Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute Delimiter to use between each 'input' tag with type 'radio'. There is no delimiter by default. HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Specifies the HTML element that is used to enclose each 'input' tag with type 'radio'. Defaults to 'span'. Enable/disable HTML escaping of rendered values. HTML Standard Attribute Value to be displayed as part of the 'input' tags with type 'radio' The Collection, Map or array of objects used to generate the 'input' tags with type 'radio' Name of the property mapped to 'value' attribute of the 'input' tags with type 'radio' HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute

cssStyle

false

true

delimiter

false

true

dir

false

true

disabled

false

true

element

false

true

htmlEscape id itemLabel

false false false

true true true

items

true

true

itemValue

false

true

lang onblur onchange onclick ondblclick onfocus onkeydown onkeypress

false false false false false false false false

true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

17/21

5/9/13

Appendix E. spring-form.tld

onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path tabindex title

false false false false false false true false false

true true true true true true true true true

HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Standard Attribute HTML Standard Attribute

E.14. The

s e l e c ttag

Renders an HTML 'select' element. Supports databinding to the selected option.

Table E.13. Attributes

Attribute
accesskey cssClass

Required?
false false

Runtime Description Expression?


true true HTML Standard Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element.

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape

false

true

Enable/disable HTML escaping of rendered values.


18/21

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

id itemLabel

false false

true true

HTML Standard Attribute Name of the property mapped to the inner text of the 'option' tag The Collection, Map or array of objects used to generate the inner 'option' tags Name of the property mapped to 'value' attribute of the 'option' tag HTML Standard Attribute HTML Optional Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Optional Attribute HTML Standard Attribute HTML Standard Attribute

items

false

true

itemValue lang multiple onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup path size tabindex title

false false false false false false false false false false false false false false false false true false false false

true true true true true true true true true true true true true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

19/21

5/9/13

Appendix E. spring-form.tld

E.15. The

t e x t a r e atag

Renders an HTML 'textarea'.

Table E.14. Attributes

Attribute
accesskey cols cssClass

Required?
false false false

Runtime Description Expression?


true true true HTML Standard Attribute HTML Required Attribute Equivalent to "class" - HTML Optional Attribute Equivalent to "class" - HTML Optional Attribute. Used when the bound field has errors. Equivalent to "style" - HTML Optional Attribute HTML Standard Attribute HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element. Enable/disable HTML escaping of rendered values. HTML Standard Attribute HTML Standard Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute
20/21

cssErrorClass

false

true

cssStyle dir

false false

true true

disabled

false

true

htmlEscape id lang onblur onchange onclick ondblclick onfocus onkeydown

false false false false false false false false false

true true true true true true true true true

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

5/9/13

Appendix E. spring-form.tld

onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onselect path

false false false false false false false false true

true true true true true true true true true

HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute HTML Event Attribute Path to property for data binding HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will make the HTML element readonly. HTML Required Attribute HTML Standard Attribute HTML Standard Attribute

readonly

false

true

rows tabindex title

false false false

true true true

Prev Appendix D. spring.tld

Home Sponsored by SpringSource

static.springsource.org/spring/docs/2.5.5/reference/spring-form.tld.html

21/21

You might also like