Is there any way to select default value in dropdown list by Spring MVC by "< form:options>" ?
I mean: If an option's id is equal to my model attribute Id, I want to select them by default.
Is there any way to select default value in dropdown list by Spring MVC by "< form:options>" ?
I mean: If an option's id is equal to my model attribute Id, I want to select them by default.
If you do:
<form:select path="optionName">
<form:options items="${your_option_types}" />
</form:select>
That will pre-select your model attribute value.