'Set default value in drop down menu in Thymeleaf
I have a table that has a column "Shoe", which is a dropdown menu

I want to set a default value for my dropdown in Thymeleaf
<option th:each="shoe : ${shoes}" th:selected="${shoe == item.getShoe()}" th:value="${shoe}" th:text="${shoe}"></option>
In the instance when item.getShoe() == '', I'd like for the default option for the dropdown menu to be just that, '', so it appears as blank on the dropdown menu.
Instead, whenever item.getShoe() == '', it is choosing the first value from the shoes list, NIKE, to be the default option for the dropdown menu.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
