The select tag

In this section, you will learn about the select tag of Spring form tag library.

The select tag

The select tag

In this section, you will learn about the select tag of Spring form tag library.

The select tag provide and an HTML 'select' element. It supports data binding to the selected option as well as the use of nested option and options tags.

Sample code is shown below :

<tr>
	<td>Skills:</td>
	<td><form:select path="skills" items="${skills}"/></td>
</tr>

The rendered HTML code will be something like this :

<tr>
	<td>Skills:</td>
	<td><select name="skills" multiple="true">
		<option value="Botany">Botany</option>
		<option value="Physics" selected="selected">Physics</option>
		<option value="Chemistry">Chemistry</option>
	</select>
	</td>
</tr>