spring add default value to form:select
Posted
by Mike
on Stack Overflow
See other posts from Stack Overflow
or by Mike
Published on 2010-05-04T14:54:02Z
Indexed on
2010/05/04
15:08 UTC
Read the original article
Hit count: 401
spring-mvc
|spring
I'm developing a spring application, now I've added a dropdownlist to one of my jsp pages using:
<form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name"/>
Now I'd like to add the default value "Nothing selected", however I can't seem to find how to do this. I've tried:
<form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name">
<form:option value="Nothing selected" />
</form:select>
But "Nothing selected" isn't displayed in my dropdownlist.
© Stack Overflow or respective owner