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. 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.
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.
Follow these steps to configure your web application with this tag library:
<taglib> <taglib-uri>http://jakarta.apache.org/taglibs/input-1.0</taglib-uri> <taglib-location>/WEB-INF/input.tld</taglib-location> </taglib>
To use the tags from this library in your JSP pages, add the following directive at the top of each page:
<%@ taglib uri="http://jakarta.apache.org/taglibs/input-1.0" prefix="input" %>
where "input" is the tag name prefix you wish to use for tags from this library. You can change this value to any prefix you like.
| text | Displays a one-line text-entry box |
| textarea | Displays a multiline textarea |
| select | Displays a select list |
| radio | Displays a radio button |
| checkbox | Displays a checkbox |
| text | Availability: 1.0 | ||||
|
Displays a one-line text-entry box. See Usage page. |
|||||
| Tag Body | empty | ||||
| Restrictions |
None |
||||
| Attributes | Name | Required | Runtime Expression Evaluation | Availability | |
| name | Yes | Yes | 1.0 | ||
|
text box name |
|||||
| default | No | Yes | 1.0 | ||
|
text box default value |
|||||
| attributes | No | Yes | 1.0 | ||
|
extra text box attributes |
|||||
| Variables | None | ||||
| Examples | None | ||||
| textarea | Availability: 1.0 | ||||
|
Displays a one-line text-entry box. See Usage page. |
|||||
| Tag Body | empty | ||||
| Restrictions |
None |
||||
| Attributes | Name | Required | Runtime Expression Evaluation | Availability | |
| name | Yes | Yes | 1.0 | ||
|
textarea name |
|||||
| default | No | Yes | 1.0 | ||
|
textarea default value |
|||||
| attributes | No | Yes | 1.0 | ||
|
extra textarea attributes |
|||||
| Variables | None | ||||
| Examples | None | ||||
| select | Availability: 1.0 | ||||
|
Displays a select list. See Usage page. |
|||||
| Tag Body | empty | ||||
| Restrictions |
None |
||||
| Attributes | Name | Required | Runtime Expression Evaluation | Availability | |
| name | Yes | Yes | 1.0 | ||
|
select name |
|||||
| default | No | Yes | 1.0 | ||
|
select default value |
|||||
| attributes | No | Yes | 1.0 | ||
|
extra select attributes |
|||||
| options | Yes | Yes | 1.0 | ||
|
options list for select |
|||||
| Variables | None | ||||
| Examples | None | ||||
| radio | Availability: 1.0 | ||||
|
Displays a radio button. See Usage page. |
|||||
| Tag Body | empty | ||||
| Restrictions |
None |
||||
| Attributes | Name | Required | Runtime Expression Evaluation | Availability | |
| name | Yes | Yes | 1.0 | ||
|
radio button name |
|||||
| default | No | Yes | 1.0 | ||
|
radio button default value. |
|||||
| value | Yes | Yes | 1.0 | ||
|
value can be empty, but it must be present |
|||||
| attributes | No | Yes | 1.0 | ||
|
extra radio button attributes |
|||||
| Variables | None | ||||
| Examples | None | ||||
| checkbox | Availability: 1.0 | ||||
|
Displays a checkbox. See Usage page. |
|||||
| Tag Body | empty | ||||
| Restrictions |
None |
||||
| Attributes | Name | Required | Runtime Expression Evaluation | Availability | |
| name | Yes | Yes | 1.0 | ||
|
checkbox name |
|||||
| default | No | Yes | 1.0 | ||
|
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 |
|||||
| defaults | No | Yes | 1.0 | ||
|
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 |
|||||
| value | Yes | Yes | 1.0 | ||
|
value can be explicitly empty, or it can be absent, in which case it defaults to "on" |
|||||
| attributes | No | Yes | 1.0 | ||
|
extra checkbox attributes |
|||||
| Variables | None | ||||
| Examples | None | ||||
See the example application input-examples.war for examples of the usage of the tags from this custom tag library.
Java programmers can view the java class documentation for this tag library as javadocs.
Review the complete revision history of this tag library.