]> Shawn Bayern and Karl von Randow 1.2 1.1 input http://jakarta.apache.org/taglibs/input-1.2 Input Tag library

The "input" tag extension library lets you present HTML <form> elements that are tied to the ServletRequest that caused the current JSP page to run, or to a JavaBean. That is, using this library, you can easily prepopulate form elements with prior values that the user has chosen -- or with default values for the first time a user hits a web page. This is useful when you need to present the same page to the user several times (e.g., for server-side validation).

You can also automatically build up <select> boxes, making it easier to build data-driven forms. And even if you don't present the same page multiple times, you may want form elements that have default values; this library lets you do that without writing excessive logic.

What is the "Input" tag library? Read more.

/WEB-INF/taglibs-input.tld input This custom tag library requires no software other than a servlet container that supports the JavaServer Pages Specification, version 1.1 or higher. Plus any requirements for additional API packages. form org.apache.taglibs.input.Form JSP form Creates a form tag. See Usage page. Creates a form tag 1.1 None name false true form name 1.1 bean false true id of the bean to use as the default bean for input elements in the form. If a default bean is set here then it is used for all form elements unless they specify an alternate bean, or specify bean="" which overrides the default bean and specifies not to use a bean. 1.1 method false true form method 1.1 action false true form action. The url will be passed through response.encodeURL(String) to add session tracking if necessary. 1.1 encodeActionURL false true If true, passes the action URL through response.encodeURL(). Defaults to true. 1.2 encType false true form encoding type deprecated enctype false true form encoding type 1.2 onsubmit false true onsubmit event handler 1.2 onreset false true onreset event handler 1.2 accept false true XHTML "accept" attribute 1.2 accept-charset false true XHTML "accept-charset" attribute 1.2 &attrs; &custom; text org.apache.taglibs.input.Text empty text Displays a one-line text-entry box. See Usage page. Displays a one-line text-entry box 1.0 None &attr-name; &attr-default; &attr-value; &attr-bean; &attrs; &focus; &input-attrs; &custom; password org.apache.taglibs.input.Password empty password Displays a one-line password-entry box. See Usage page. Displays a one-line password-entry box 1.1 None &attr-name; &attr-default; &attr-value; &attr-bean; &attrs; &focus; &input-attrs; &custom; textarea org.apache.taglibs.input.TextArea JSP textarea Displays a multi-line text-entry box. The body of the textarea tag will be used as the default value if the default attribute is not provided. See Usage page. Displays a multiline textarea 1.0 None &attr-name; &attr-default; &attr-value; &attr-bean; cols false true the number of columns in the text area 1.1 rows false true the number of rows in the text area 1.1 &attrs; &focus; disabled false true HTML textarea tag "disabled" attribute: true/false 1.1 readonly false true HTML textarea tag "readonly" attribute: true/false 1.1 onselect false true HTML textarea tag "onselect" attribute 1.1 onchange false true HTML textarea tag "onchange" attribute 1.1 &custom; hidden org.apache.taglibs.input.Hidden empty hidden Creates a hidden form field. See Usage page. Creates a hidden form field 1.1 None &attr-name; &attr-default; &attr-value; &attr-bean; &attrs; &focus; &input-attrs; &custom; select org.apache.taglibs.input.Select JSP select Displays a select list. See Usage page. Displays a select list 1.0 None &attr-name; &attr-default; defaults false true The default and defaults attributes for select are concatenated together (if they are both specified). The defaults attribute may be a String[], Map or Collection. 1.0 selectedValue false true The selected value for this select box. The value is used if no bean is specified or if the bean doesn't exist. The value overrides any request parameters or default value, even if the value is null. Unless you require this functionality it is recommended that you use the "default" attribute instead so that the form can autopopulate from the request parameters. 1.2 selectedValues false true As for "selectedValue" but takes an array of values. If both "selectedValue" and "selectedValues" are provided they are concatenated. 1.2 &attr-bean; multiple false true whether multiple choices are permitted by the select box (true|false) 1.1 size false true select box size 1.1 options false true java.util.Map options map for select. The key is the option label and the value is the option value. Suggest using a java.util.LinkedHashMap so that you can control the order of keys. 1.0 optionsValueLabel false true java.util.Map options map for select. The key is the option value and the value is the option label. This is the opposite way around to the options attribute. Suggest using a java.util.LinkedHashMap so that you can control the order of keys. 1.2 optionLabels false true java.util.List options labels for select 1.1 optionValues false true java.util.List options values for select 1.1 disabled false true HTML select tag "disabled" attribute: true/false 1.2 &attrs; tabindex false true XHTML "tabindex" attribute 1.2 onfocus false true XHTML "onfocus" attribute 1.2 onblur false true XHTML "onblur" attribute 1.2 onchange false true HTML select tag "onchange" attribute 1.2 &custom; option org.apache.taglibs.input.Option JSP option Displays a select option. The body of the option tag becomes the label of the option. If the value attribute is not provided then the body also becomes the value of the option. See Usage page. Displays a select option 1.1 None value false true the option value 1.1 disabled false true HTML select tag "disabled" attribute: true/false 1.1 &attrs; &custom; radio org.apache.taglibs.input.Radio empty radio Displays a radio button. See Usage page. Displays a radio button 1.0 None &attr-name; &attr-default; value true true java.lang.String value can be empty, but it must be present 1.0 &attr-checked; &attr-bean; &attrs; &focus; &input-attrs; &custom; checkbox org.apache.taglibs.input.Checkbox empty checkbox Displays a checkbox. See Usage page. Displays a checkbox 1.0 None &attr-name; default false true The two "defaults" for checkbox are concatenated together to form an array of size (defaults.length + 1), or 1 if defaults.length is null or isn't present 1.0 defaults false true The two "defaults" for checkbox are concatenated together to form an array of size (defaults.length + 1), or 1 if defaults.length is null or isn't present 1.0 value true true java.lang.String value can be explicitly empty, or it can be absent, in which case it defaults to "on" 1.0 &attr-checked; currentValues false true As for "currentValue" but takes an array of values. If both "currentValue" and "currentValues" are provided they are concatenated. 1.2 &attr-bean; &attrs; &focus; &input-attrs; &custom;
W3C validation fixes for select, radio and checkbox. Size, cols and rows attributes added to text, password and textarea fields. Textarea field can now take a body as the default value. Addition of new functionality, making some parts of the taglib easier to use, and more similar to the functionality of the struts input tags without being tied to the struts architecture.
JavaBean peer support. Each tag (or an entire form) can have a JavaBean that it draws default values from before looking in the request or the tag's default values. AttributesText attribute on input tags to simplify the addition of attributes to input tags, versus the attributes attribute. Option tags to be nested within Select tags, to simplify the addition of options to a select tag. Option list attributes for the Select tag to facilitate ordered options in select tags. Form tag to handle url encoding of the form action and JavaBean default. Add multiple attribute to select tag, and support for multiple defaults.
TODO The new features list serves as notes for writing this.
Array support Checkbox default usage detection Add value, selectedValue(s), checkedValue(s) to tags to force a value