<%@ taglib uri="http://jakarta.apache.org/taglibs/input-1.2" prefix="input" %>

Previously you had to set the value of a form element using the "default" attribute, which meant that a matching request parameter would override it. As of version 1.2 there is a "value" attribute on most input tags that lets you specify the actual value to use.

With value:

With default value:


With selectedValue:
one two three
With default:
one two three
With multiple selectedValues:
<% String[] selectedValues = new String[2]; selectedValues[0] = "1"; selectedValues[1] = "2"; %> one two three

With checkedValue: a b c d
With default: a b c d

<% String[] defaults = new String[2]; defaults[0] = "2"; defaults[1] = "5"; %> With checkedValues: 1 2 3 4 5
With default: 1 2 3 4 5