How do I select an option using Spring's form:select tag?

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2012-11-28T17:02:49Z Indexed on 2012/11/28 17:03 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

I'm using Spring 3.1.1.RELEASE. Using the form:select tag, how do I specify which option should be selected? I want the first one to be selected, but when I put

            <form:select path="parentOrganization">
                <form:option value="" label="Select an Org Type or Parent Org" />
                <form:options items="${orgTypesWoParents}" itemValue="id" itemLabel="description" />
                <form:option value="" label="=======================" />
            </form:select>

the last one is selected. I want to preserve the order of how everything is displayed, which is why I've arranged things in this way.

© Stack Overflow or respective owner

Related posts about forms

Related posts about spring