Вы должны обернуть свой скрипт в эту структуру:
<script th:inline="javascript">
/*<![CDATA[*/
$( document ).ready(function() {
for(i=0;i<10;i++) {
...
}
});
/*]]>*/
</script>
EDIT:
Не забудьте сохранить ваши javascript и другие статические файлы в папке /src/main/webapp
ваш проект весенней загрузки
EDIT2:
Вы можете напрямую использовать свой скрипт с тимелеафом:
<tr th:each="i : ${#numbers.sequence( 1, db.columns_number)}">
<td><input id="field" th:name="${'field'+i}" maxlength="255"
required="required" type="text" /></td>
<td><input id="Size" th:name="${'Size'+i}" maxlength="255"
required="required" type="text" /></td>
<td><select id="Type" th:name="${'Type'+i}">
...
</select></td>
<td><select id="null" th:name="${'nullabilite'+i}">
<option value="null">null</option>
<option value="not_null">not_null</option>
</select></td>
</tr>