1

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.

1 Answer 1

1

If you do:

<form:select path="optionName">
    <form:options items="${your_option_types}" />
</form:select>

That will pre-select your model attribute value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.