In spring based web app using hibernate I have a lists.html file where are select options codes reused in many views, now options will be transferred to database and my task is to populate those lists from db. This code will be rarely updated.This is example of list and its usage.
lists.html
<select th:fragment="typeList">
<option selected value=""></option>
<option th:value="|1|" th:text="|Type #1|"></option>
<option th:value="|2|" th:text="|Type #2|"></option>
<option th:value="|3|" th:text="|Type #3|"></option>
<option th:value="|4|" th:text="|Type #4|"></option>
</select>
usage
<li>
<label for="type" th:text="#{type.label}">type</label>
<select th:field="*{type}" th:include="html/fragments/lists :: typeList"></select>
</li>
What is the best method to build this lists.html from database dictionary?